Concepts8

⚙️AlgorithmIntermediate

Problem Classification Patterns

Many competitive programming problems map to a small set of classic patterns; recognizing keywords and constraints lets you pick the right tool fast.

#problem classification#binary search on answer#two pointers+12
⚙️AlgorithmIntermediate

Fix One Variable Technique

The Fix One Variable technique reduces multi-variable search problems by enumerating one variable explicitly and optimizing over the others with structure.

#fix one variable#dimension reduction#two pointers+12
⚙️AlgorithmIntermediate

Invariant Maintenance

An invariant is a property you promise to keep true throughout an algorithm, and it is the anchor of both design and correctness proofs.

#invariant#loop invariant#search invariant+12
⚙️AlgorithmIntermediate

Mo's Algorithm

Mo's algorithm answers many range queries offline by reordering them to minimize pointer movement along the array.

#mo's algorithm#offline queries#range queries+12
⚙️AlgorithmIntermediate

Sliding Window

Sliding window is a technique that moves a contiguous segment (window) across an array or string while maintaining some running information like sum, count, or max.

#sliding window#two pointers#variable window+11
⚙️AlgorithmIntermediate

Two Pointers

Two pointers is a pattern where two indices move through a sequence in a coordinated, usually monotonic way to avoid unnecessary work.

#two pointers#sliding window#opposite ends+12
🗂️Data StructureAdvanced

Centroid Decomposition

Centroid decomposition splits a tree around a special node (centroid) so that every remaining component has at most half the nodes.

#centroid decomposition#centroid tree#tree algorithms+11
🗂️Data StructureIntermediate

Monotonic Deque

A monotonic deque is a double-ended queue that keeps elements in increasing or decreasing order so that the front always holds the current optimum (min or max).

#monotonic deque#sliding window maximum#sliding window minimum+12