State exactly when the smaller problem is complete or impossible.
Recursion and Backtracking
6 chapters · 13 challenges · The Branching Labyrinth
Understand the idea, practise through play, then prove it in code. Choose your next quest below.
Visual introduction to this topic
What are recursion and backtracking?
Recursion solves a problem by calling the same rule on a smaller state. Backtracking explores choices, restores the state, and returns to try the next branch.
Think of exploring a maze. Mark a turn, walk until it fails, then return to the last fork and restore the path before choosing again.
Choose, recurse, undo. Every path represents one candidate answer.
Mutate before recursion and undo afterward, or copy deliberately.
Constraints can stop a subtree before all of its leaves are generated.
Choose, explore, undo
Decision Tree
0/3 completePractice decision tree through 3 visual expeditions.
Subsets
0/2 completePractice subsets through 2 visual expeditions.
Permutations
0/2 completePractice permutations through 2 visual expeditions.
Combinations
0/2 completePractice combinations through 2 visual expeditions.
Constraint Pruning
0/2 completePractice constraint pruning through 2 visual expeditions.
Board Search
0/2 completePractice board search through 2 visual expeditions.
Built from authoritative material
This track is checked against the sources below. Visual traces still carry their own complete or guided coverage label, so unfinished explanations are not presented as complete executions.