Algorithm · Oracle · Medium
Requirements For a two-dimensional board containing '1' for ground and '0' for sea, determine how many separate islands it contains. Land squares belong to one island when they touch on an edge; diagonal contact does not connect them. A standard depth-first or breadth-first traversal that records land already reached is sufficient. Use the following callable shape: After the implementation succeeds, be prepared to give exact running-time and memory-complexity bounds.…
Checking your access…