The # tokens preserve missing children, so the shape is not guessed.
Warm-up MCQs
1. Which invariant separates BFS levels?
Lesson 31 invariant: "A queue processes nodes in the order discovered; snapshot the queue length to process exactly one level at a time."
2. Which line matches inorder traversal?
Lesson 28 invariant: "Inorder means: fully visit the left subtree, then this node, then the right subtree — recursion does the bookkeeping for you."
3. Which choice misses diameter piggybacking?
Lesson 32 invariant: "Compute height recursively and carry the real answer up alongside it — one traversal answers both questions."
4. Why are null markers required?
Lesson 34 invariant: "Preorder with explicit null markers is unambiguous — the string rebuilds exactly one tree."
5. Which fact splits construction ranges?
Lesson 36 invariant: "The first preorder value is the root, and its position in inorder splits everything into left and right subtrees — recurse with a hashmap for O(1) splits."
6. When can Path Sum return true?
Lesson 35 invariant: "Subtract the node's value as you descend; a path exists iff some leaf sees exactly zero remaining."
Self-check gate
Pass tonight only if
You started Problem 1 within five minutes of opening this page.
Before each problem, you said the pattern name, approach, and complexity out loud.
You got at least two accepted solutions inside the 60-minute timer.
Any failed problem has one precise note tied to the missed invariant.
If you fail: add every failed or silent problem to the next revision list. Write WA: missed invariant - queue snapshot, WA: missed invariant - height plus answer, or WA: missed invariant - null markers, then re-solve from a blank file.