Number of islands problem - Graphs


Given a 2d grid map of '1's (land) and '0's (water), count the number of islands. An island is surrounded by water and is formed by connecting adjacent lands horizontally or vertically. You may assume all four edges of the grid are all surrounded by water.

Comments

Popular posts from this blog

Java important topics list for interviews

DBMS important topics list for interviews

Tough Sql practise questions for interviews involving SELECT queries - Part 2

Program to find number lines and words in a given file

Producer Consumer Problem with Blocking Queue in Java.

Animation for String search - KMP Algorithm

Tough Sql practise questions for interviews involving SELECT queries - Part 1

Maze Problem - Backtracking

Interactive Data Structure visualizations/animations for algorithms