This page is the module index for backtracking and array patterns.
backtracking/search.py— permutations, combinations, subsets, N-queens count.
Focused lessons
- Two-pointer patterns
- Sliding windows
- Prefix sums
- Backtracking search
- Greedy methods
- Dynamic programming state and transitions
patterns/arrays.py— two pointers, sliding window, prefix sums, monotonic-queue window maximum.
Industry
A working engineer writes a backtracking search when a partial choice can be
rejected, and a forward scan when the constraint is a window. The
sliding-window maximum in this lesson keeps candidate indexes in a
collections.deque. Python documents approximately O(1) appends and pops at
either end, so each index can enter the deque and leave it once.