mirror of
https://github.com/TheAlgorithms/Ruby
synced 2024-12-26 21:58:56 +01:00
Merge pull request #1 from sidaksohi/sidaksohi-patch-1
Update number_of_islands.rb
This commit is contained in:
commit
2d3aaaf4a0
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…
Reference in a new issue