Tag: numberofislands
-
Data Structures & Algorithms in Java – Graphs – Number of Islands
Problem: Given a m * n grid representing a map with the value 1 representing land and the value 0 representing water, find out the number of islands in the grid. That is find out the piece of area containing ‘1’s surrounded on all sides by ‘0’s or the grid boundaries (Assume the entire grid…