BFS44 articles
DSA
DFS flood-fill to find the largest connected island. Time O(m×n), Space O(m×n).
Binary Trees. Time O(n), Space O(n).
Graphs. Time O(m log n), Space O(m+n).
DFS - Backtracking approach. Optimal — Time O(mn * 4^L), Space O(1).
Graphs problem — solution with code and analysis.
Graphs. Time O(V^2).
Graphs. Time O(V+E).
Graphs. Time O(ElogV).
Covers: To Note, DFS, BFS. Optimal — Time O(m x n), Space O(m x n).
DFS vs BFS approach. Optimal — Time O(V^2), Space O(n).
Covers: 1. DFS Based, Disjoint Set Based. Optimal — Time O(m * alpha(n), Space O(n).
Covers: DFS, Union Find. Optimal — Time O(V + E), Space O(V).
Graphs. Time O(mxn), Space O(mxn).
Covers: Dijkstra's Algo, Floyd warshall's. Optimal — Time O(n^3), Space O(n^2).
Graphs. Space O(V).
Graphs. Time O(Q × (V + E), Space O(V).
Using DFS approach. Optimal — Time O(Q *(N+P), Space O(N+P).
Graphs. Time O(N), Space O(V+E).
Graphs. Time O(V+E), Space O(V+E).
Covers: DFS, BFS - TOPOLOGICAL. Optimal — Time O(N+E), Space O(N).
Graphs. Time O(ElogE), Space O(V^2).
Graphs. Time O(ElogE), Space O(V+E).
Alogrithm approach. Optimal — Time O(V^3 ), Space O(V^2 ).
Graphs. Time O(2^N * N), Space O(2^N * N).
5 approaches incl. Negative weight cycle:, Why (V-1) times?, Detection of a Negative Weig…, and more. Optimal — Time O(V*E), Space O(V).
Covers: Data structures Used, If path is needed. Optimal — Time O( (E+V), Space O( |V| ).
The Algorithm approach. Optimal — Time O(V+E), Space O(V+E).
Covers: Sample 1, Sample 2, Observations. Optimal — Time O(N*(V+E).
Using BFS - Kahn's Algo approach. Optimal — Time O(N+P), Space O(N+P).