Search problems, tracks, editorials
/
47
lvl
14
rating
1,684
↑42
AR
Loading
Learn
/
INTERMEDIATE
Trees & Traversal
.
Binary trees, BSTs, and the recursive shape behind most tree problems.
Dr. Lena Hoff
24 lessons
6 h 40 m
tree
bst
recursion
Your progress
61%
7 / 12 shown
continue
download for offline
save to library
open my notes
MODULE 01
Traversal orders
5 lessons
What a tree actually is
Nodes, edges, height versus depth, and why the recursive definition is the useful one.
video
8:12
The four traversals, animated
Pre-, in-, post-order and level order, drawn frame by frame on one tree.
animated
11:40
Doing it without recursion
An explicit stack, and the one line people get wrong converting post-order.
video
9:55
Traversal cheat sheet
One page you can keep open while you solve.
reading
6 min read
Checkpoint: traversal orders
Predict the output before you run it.
checkpoint
8 questions
MODULE 02
Binary search trees
5 lessons
The BST invariant
Why every node constrains an entire subtree, not just its children.
video
10:20
Bounds, not parents
The classic validation bug, and the two fixes that are secretly the same fix.
animated
7:35
Searching and descending
Search, insert, delete, and the LCA descent you are about to implement.
video
12:08
When a BST degrades
Sorted insertion, linked-list shaped trees, and what balancing buys you.
reading
9 min read
Checkpoint: binary search trees
Six invariant questions and four complexity questions.
checkpoint
10 questions
MODULE 03
Construction & serialisation
2 lessons
Rebuilding from traversals
Preorder gives you the root; inorder gives you the split.
animated
13:45
Serialisation formats
Null markers, level order, and round-tripping a tree through a string.
video
10:02