DSA learning path
Trees & Graphs
BFS, DFS, recursion and topological order.
Problems in this path
- Maximum Depth of a Binary TreeOpen
Easy · Depth-First Search - Level Order TraversalOpen
Medium · Breadth-First Search - Validate a Binary Search TreeOpen
Medium · Depth-First Search - Number of IslandsOpen
Medium · Grid DFS - Course ScheduleOpen
Medium · Topological Sort - Shortest Paths with DijkstraOpen
Medium · Dijkstra's Algorithm - Minimum Cost to Connect a GraphOpen
Hard · Kruskal + Union-Find - Binary Tree Inorder TraversalOpen
Easy · Iterative Tree Stack - Binary Tree DiameterOpen
Medium · Postorder Heights - Check Tree Height BalanceOpen
Easy · Sentinel Postorder
Read first
Binary Trees and Traversals
Roots, children and leaves; the four ways to walk a tree (pre-, in-, post- and level-order); and how recursion makes tree code short.
15 min readBinary Search Trees
A binary tree that keeps itself sorted. How search, insert and the three cases of delete work, and why balance decides whether it's O(log n) or O(n).
16 min readGraphs, BFS and DFS
Vertices and edges, adjacency lists, and the two ways to explore a graph: breadth-first search for shortest paths and depth-first search for everything else.
17 min readWeighted Graphs, Dijkstra and Union–Find
Extend BFS to weighted shortest paths, connect a graph at minimum cost, and maintain changing components with union–find.
21 min read