Your free access ends in 7 days — and you haven’t tried it yet. Watch one algorithm run, start to finish. It takes about two minutes.

Try one problem
0
Concept

Solution Space Trees

Nodes = partial solutions, edges = choices
step 1 / 14
nodes = partial solutions, edges = choices
{1}
{1,2}
take 1
{ }
{2}
skip 1
{ }
leaves reached
(none yet)
The mental model behind every backtracking problem
1tree = solution space:
2 root = empty solution
3 edge = one decision
4 node = partial solution
5 leaf = complete solution (valid or dead)
6explore(node):
7 if rule already broken: prune subtree // cut, do not recurse
8 else for each edge: explore(child)
9 collect valid leaves
state
  • examplesubsets of [1, 2]

line 1Every backtracking problem is secretly the SAME object: a solution-space tree. The root is the empty solution, each edge is one decision, internal nodes are partial solutions, and leaves are complete solutions — some valid, some dead.