- 1
Go Deep First
Recursion mirrors the tree: dive to a leaf, let null stop you, and combine what the children return.
Complete codeMultiple choiceTap - 2
Invert Binary Tree
One swap per node — recursion carries it to every corner of the tree.
Complete codeMultiple choiceTrace - 3
Path Sum
Subtract as you descend — and remember that only a leaf can finish the path.
Complete codeDebugMultiple choiceTrace - 4
Diameter of Binary Tree
One recursion, two quantities: each node's best path is leftHeight + rightHeight, but the function must hand its parent a height.
Complete codeDebugMultiple choiceTrace - 5
LCA of a BST
BST ordering turns LCA into a single walk: both smaller go left, both larger go right, and the split point is the answer.
Complete codeMultiple choiceTrace - 6
Kth Smallest in a BST
Inorder traversal of a BST visits values in sorted order — count the visits and stop the recursion at the kth.
Complete codeDebugMultiple choiceTrace - 7
Tree DFS CheckpointCheckpoint
No new concepts — transfer the island's DFS moves to unseen trees: walking two trees at once, carrying path state down, and summing subtrees bottom-up.
Complete codeCode orderMultiple choiceTrace - 8
Tree DFS ReviewReview
Mixed recap of the island: state flowing down vs answers flowing up, BST ordering shortcuts, picking a traversal order, base cases, and the price of recomputing heights.
Complete codeMultiple choiceTrace - 9
Boss: Validate Binary Search TreeBoss
The island's final test: prove a tree is a BST. Every node must respect bounds set by ALL of its ancestors — checking children against parents is the trap. Carry (lo, hi) down, or verify the inorder walk climbs strictly.
Complete codeDebugCode orderMultiple choiceTrace
Trees & Graphs is part of AlgoFox Pro
You can read the whole course outline here. The exercises are in the app, along with your streak, your mistake review, and the progress that carries across your devices.
Pro starts with a 3 day free trial. The app store decides who is eligible for an introductory offer, and a lapsed subscription does not get another one.
Already subscribed in the app? Sign in with the same account and Pro works here too. Quick Play and Battle are free on the web, and so is the first course in every subject.
