Skip to content

Glossary: Coding Interviews in Java

Backtracking

Also written: choose, explore, un-choose

Building every possible answer one choice at a time: choose an item, explore the rest by recursion, then un-choose it so the next branch starts clean. It costs O(2ⁿ), so it suits small inputs.

Where the book teaches it

Related terms

PathPruningSubsetExponential time