filmov
tv
Number of Islands: Solution using both BFS and DFS - Leetcode 200 - Array - Matrix - BFS - DFS

Показать описание
#amazoninterview #leetcode #coding #codinginterviewprep #leetcodejava #problemsolving #meta #algorithm
Number of Islands - Leetcode 200 - Breadth First Search - Depth First Search - Java
Problem link with details at website:
For BFS,
Time Complexity O(mn) ,
Space Complexity - O(min(mn))
For DFS,
Time Complexity O(mn) ,
Space Complexity - O(mn)
Disjoint Set (Union Find) Data Structure ( Union by Size, Union by Rank, Union by both Size and Rank)
Flood Fill ( Leetcode 733)
Number of Provinces (Leetcode 547)
Roads and Libraries:
Join Linkedin group Algorithm Avengers to learn and share your thoughts regarding Problem Solving, Data Structures and Algorithms:
Timestamps:
0:00 Understanding the problem
2:37 Different approach of solving this problem
8:15 coding using Breadth First Search
6:07 comparison of Time and Space Complexity using DFS and BFS
22:43 Testing
23:29 Code walk through using Depth First Search
25:42 Time Space Complexity
@code_design
Number of Islands - Leetcode 200 - Breadth First Search - Depth First Search - Java
Problem link with details at website:
For BFS,
Time Complexity O(mn) ,
Space Complexity - O(min(mn))
For DFS,
Time Complexity O(mn) ,
Space Complexity - O(mn)
Disjoint Set (Union Find) Data Structure ( Union by Size, Union by Rank, Union by both Size and Rank)
Flood Fill ( Leetcode 733)
Number of Provinces (Leetcode 547)
Roads and Libraries:
Join Linkedin group Algorithm Avengers to learn and share your thoughts regarding Problem Solving, Data Structures and Algorithms:
Timestamps:
0:00 Understanding the problem
2:37 Different approach of solving this problem
8:15 coding using Breadth First Search
6:07 comparison of Time and Space Complexity using DFS and BFS
22:43 Testing
23:29 Code walk through using Depth First Search
25:42 Time Space Complexity
@code_design