Foundations
Linear Structures
Hashing
Array and String Patterns
Recursion, Search, and Sorting
Problem Solving Patterns
Algorithm Searching
Sorting Algorithms
Array Algorithms
Grid Algorithms
Linear Structure Algorithms
Hashing Algorithms
Recursion and Backtracking
Greedy Algorithms
Tree and Heap Algorithms
Graph Algorithms
Dynamic Programming Algorithms
String Algorithms
Math Algorithms
Keyboard ready
Space plays. Arrow keys step. R restarts.
LAB Backtracking Thinking Lab
Problem Solving
Concept shape
Practice pattern
0
1
2
3
4
5
Definition
Backtracking explores choices, abandons invalid paths, and undoes choices when returning.
Step 1 / 5
Concept shape
Problem Solving Practice pattern
Backtracking Thinking
Welcome to the Backtracking Thinking concept lab. Backtracking explores choices, abandons invalid paths, and undoes choices when returning. The must know points are: Use for exhaustive search with constraints. The undo step matters. Pruning makes it faster. The common operations are: choose, explore, unchoose, prune. The complexity shape is Often exponential. Watch out for these pitfalls: Forgetting to undo state. Not pruning invalid branches early. Related algorithms include Generate Subsets, Generate Permutations.
Concept details
Backtracking explores choices, abandons invalid paths, and undoes choices when returning.
Must know
- Use for exhaustive search with constraints.
- The undo step matters.
- Pruning makes it faster.
Complexity
Often exponential
1.0x