mirror of
https://github.com/TheAlgorithms/Ruby
synced 2025-01-29 20:34:27 +01:00
Update number_of_islands.rb
This commit is contained in:
parent
5b482ee1b5
commit
0df030f25a
1 changed files with 1 additions and 1 deletions
|
@ -28,7 +28,7 @@
|
|||
|
||||
|
||||
|
||||
#DFS, Recursive Bottom Up Approach - O(n^2) Time / O(1) Space
|
||||
#DFS, Recursive Bottom Up Approach - O(n*m) Time / O(1) Space
|
||||
#Init num_of_islands = 0, return if the grid is empty
|
||||
#Start a double loop with index to iterate through each plot (each value is a plot of either water or land in this case)
|
||||
#if the plot is land, dfs(grid, x, y)
|
||||
|
|
Loading…
Add table
Reference in a new issue