BFS vs DFS: Choosing the Right Graph Traversal for the Job
Understand the difference between breadth-first and depth-first search, when each traversal is the right fit, and how they show up in trees, graphs, and grids.
graphs
bfs
dfs
traversal
Practical guides to the algorithm patterns that show up in real interviews.
Understand the difference between breadth-first and depth-first search, when each traversal is the right fit, and how they show up in trees, graphs, and grids.
Learn when heaps are the right data structure, how min-heaps and max-heaps work, and why they shine in top-k and streaming problems.
Understand disjoint set union, path compression, and union by rank so you can solve connectivity problems efficiently.
Learn how topological sorting works, why it only applies to DAGs, and how to solve course scheduling and dependency ordering problems.
Turn any LeetCode problem into an interactive lesson — trace variables, visualize the algorithm, and practice until it clicks.
Start a free lesson