solution-space tree
{1,2,3}
{1,2}
{1,3}
{1}
{2,3}
{2}
{3}
{ }
subsets found
(none yet)
Backtracking · extend with later elements
▸1subsets(start, path):2 record path // every node is a subset3 for i in start..n−1:4 path.push(arr[i]) // choose5 subsets(i+1, path) // explore6 path.pop() // un-choose (backtrack)
state
- input[1, 2, 3]