Backtracking mind map
Explore decision trees depth-first, undo dead ends.
Core idea: Model a decision tree: choose → explore → unchoose; prune as soon as the partial answer cannot win.
Mnemonic: Choose → recurse → undo · Cost: Search tree · prune early
Enumerate: Take, skip, or choose
Signal: The output is every subset or combination.
Move: Branch on the next legal choice and advance the start index to prevent reuse.
Examples: Subsets, Combinations, Combination Sum
Arrange: Fix one position
Signal: Order matters and every item may occupy the current slot.
Move: Swap or mark used, recurse to the next position, then restore the choice.
Examples: Permutations, Letter Case Permutation, Phone Combinations
Partition: Valid prefix
Signal: A sequence must split into pieces that each satisfy a rule.
Move: Try each valid next prefix; recurse on the suffix and memoize repeated suffixes if needed.
Examples: Palindrome Partitioning, Restore IP Addresses, Word Break II
Navigate: Constraint search
Signal: Choices interact across a board, graph, or shared constraint set.
Move: Mark the current choice, prune conflicts before descending, and restore on return.
Examples: Word Search, N-Queens, Sudoku Solver