Number of Islands using DFS and BFS
Filed under Amadeus
The question
Given a 2D grid of 1s (land) and 0s (water), count the number of distinct islands. Provide pseudocode solutions using both Depth-First Search (DFS) and Breadth-First Search (BFS), along with time and space complexity analysis.
No write-up yet. Related questions below have one.
Related Amadeus questions
Collected from public candidate posts and coding forums. Updated Nov 2026.