Home
Learn
Feed
Ladder
Saved
← Paths
🌳
Graphs & Trees
Traversals, shortest paths, union-find, and tree algorithms.
Curriculum · 91 lessons
01
Naive String Matching
intro
4m
02
Matrix Traversal
intro
4m
03
AVL Tree Rotations
intro
4m
04
Max Flow and Min Cut
intro
4m
05
Graph Representation Tradeoffs
intro
4m
06
KMP Pattern Matching Deep
intro
5m
07
Dijkstra with Decrease Key
intro
5m
08
Breadth First Search on Graphs
intro
4m
09
Breadth First Search Applications
intro
4m
10
The B Tree And B Plus Tree
intro
5m
11
Depth First Search Applications
intro
4m
12
Red Black Tree Rules Deep
intro
5m
13
Depth First Search on Graphs
core
4m
14
Checking if a Graph is Bipartite
core
4m
15
Topological Sort DFS
core
5m
16
Tail Recursion and Stack Depth
core
5m
17
SPFA Shortest Path
core
5m
18
The State Space Tree
core
4m
19
Cycle Detection In Undirected Graphs
core
4m
20
Bellman Ford Negative Cycle
core
6m
21
Multi Source BFS
core
4m
22
Rolling Hash for Matching
core
6m
23
Bipartite Matching
core
5m
24
The Splay Tree
core
4m
25
Depth First Search
core
4m
26
Breadth First Search
core
5m
27
Detecting Cycles in Directed Graphs
core
5m
28
Cycle Detection In Directed Graphs
core
4m
29
The Segment Tree Build
core
5m
30
The Topological Sort Pattern
core
5m
31
The Recursion Tree Method
core
5m
32
Kruskal with Union Find Deep
core
6m
33
The Two Heaps Pattern for Medians
core
5m
34
The Segment Tree
core
6m
35
Topological Sort With Kahn
core
5m
36
The Segment Tree Intro
core
5m
37
The Fenwick Tree Deep
core
5m
38
Heap Sort With A Heap
core
5m
39
Prim with Heap Deep
core
6m
40
The Euler Tour Technique
core
5m
41
The Binary Search Tree
core
5m
42
Minimum Spanning Tree With Prim
core
5m
43
The Fenwick Binary Indexed Tree
core
5m
44
Bellman Ford and Negative Edges
core
5m
45
The Binary Heap Operations
core
5m
46
Binary Indexed Tree Applications
core
5m
47
Dijkstra With A Heap
core
5m
48
The Segment Tree Range Query
core
5m
49
The Lowest Common Ancestor Binary Lifting
core
5m
50
Lowest Common Ancestor with Binary Lifting
core
5m
51
The Wildcard Matching DP
core
6m
52
DP on Trees
core
5m
53
The Two Heaps Pattern
core
5m
54
The Binary Heap
core
5m
55
Bellman Ford For Negative Edges
core
5m
56
The Interval Tree
core
5m
57
The Segment Tree Lazy Deep
core
6m
58
Topological Sort
core
5m
59
Maximum Flow with Edmonds Karp
core
5m
60
Minimum Spanning Tree with Kruskal
core
5m
61
Bipartite Matching with Hopcroft Karp
core
5m
62
KD Tree For Nearest Neighbor
core
6m
63
The Merge Sort Tree
core
5m
64
Tarjan Strongly Connected Components
core
5m
65
The Balanced AVL Tree
core
5m
66
The DFS Template
advanced
5m
67
The BFS Template
advanced
5m
68
Integer Overflow Handling
advanced
5m
69
The Min Cut Max Flow Theorem
advanced
5m
70
Wildcard And Regex Matching DP
advanced
6m
71
Minimum Spanning Tree
advanced
6m
72
Zero One BFS with a Deque
advanced
5m
73
The Balanced Tree AVL
advanced
5m
74
Union Find
advanced
5m
75
Bipartite Check By Coloring
advanced
4m
76
The Line Sweep with a Balanced Tree
advanced
6m
77
The Red Black Tree Idea
advanced
6m
78
The Persistent Segment Tree
advanced
6m
79
Union Find With Path Compression
advanced
5m
80
The Red Black Tree Intuition
advanced
5m
81
The Union Find Structure
advanced
5m
82
KMP String Matching
advanced
6m
83
The Centroid Decomposition
advanced
6m
84
Centroid Decomposition
advanced
6m
85
Dijkstra Shortest Path
advanced
6m
86
Fenwick Tree Basics
advanced
5m
87
DSU on Tree Small to Large
advanced
5m
88
Articulation Points and Bridges
advanced
5m
89
Segment Tree Basics
advanced
6m
90
Strongly Connected Components
advanced
6m
91
The Suffix Tree Idea
advanced
5m
Practice · 449 problems
⚔️
Count Nodes
1000
⚔️
Count Nodes in Binary Tree
1000
⚔️
Maximum Depth of Binary Tree
1050
⚔️
Sum of All Values
1050
⚔️
Inorder Traversal
1050
⚔️
Preorder Traversal
1050
⚔️
Island Perimeter
1050
⚔️
Kth Largest in a Stream
1050
⚔️
Can Finish Courses
1050
⚔️
Serialize Tree to Level Order
1050
⚔️
Maximum Depth of a Binary Tree
1050
⚔️
Inorder Traversal Array
1050
⚔️
Sum of All Node Values
1050
⚔️
Count Tree Nodes
1050
⚔️
Increasing Order Traversal
1080
⚔️
Preorder Traversal Array
1080
⚔️
Find Maximum Value
1100
⚔️
Find Center of Star Graph
1100
⚔️
Find the Town Judge
1100
⚔️
Postorder Traversal
1100
⚔️
Max Area of Island
1100
⚔️
Count Connected Components
1100
⚔️
Sort Characters by Frequency
1100
⚔️
Sum of Left Leaves
1100
+ 425 more in the arena