Skip to content

Conversation

ahmedabougabal
Copy link
Owner

…ber of interconnected islands '1' surrounded by '0' water using a custom queue implementation

adds directional vectors for exploring adjacent cells (up, down, left, right) used in place modification by marking visited cells as '0' to avoid revisiting -- my algo explanation >>
iterate through each cell in a grid
island count is incremented when tackling '1'
time complexity : O(m*n) , m and n are grid dimensions (nested for loop)

…ber of interconnected islands '1' surrounded by '0' water using a custom queue implementation

adds directional vectors for exploring adjacent cells (up, down, left, right)
used in place modification by marking visited cells as '0' to avoid revisiting
-- my algo explanation >>
iterate through each cell in a grid
island count is incremented when tackling '1'
time complexity : O(m*n) , m and n are grid dimensions (nested for loop)
@ahmedabougabal ahmedabougabal merged commit 042ca1e into main Nov 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant