Articles in this series
Techniques Graph Simple DFS Approach: If the current pixel already has the newColor, return the image as it is. Call the utility dfs function...
Techniques Used Graph DFS Approach Initialize the visited matrix to keep track of visited elements & also the island_count. Apply nested for loops...
Techniques Used Graph Simple DFS Similar Problems Number of Islands Max Area of Island Approach Initialize the visited matrix to keep track of...
Techniques Used Graph Simple DFS Similar Problem 1254 Number of Closed Islands Approach Apply dfs on the boundary elements which are 1's, and...
Techniques Used Graph Matrix Simple DFS Approach For each element in the grid, if it has not been visited yet, and is not 0 we perform dfs for...
Techniques Used Graph DFS Approach 1 (Brute-force, Slow) We maintain a flag variable (an array of length 2), storing the flag variables for both...