A technique is a specific, reusable trick that recognizes a problem shape and cuts its cost — narrower than a full paradigm (greedy, DP, divide and conquer), not a single named algorithm that solves one well-defined problem outright (Dijkstra, KMP), and not a data structure on its own (though several techniques are built on top of one). Each row below is a map pointer, not a re-explanation — read the linked note for the real derivation, proof and tested code.

Array and sequence techniques

TechniqueRecognizesNoteGain
Two pointers / sliding windowa contiguous-range condition that’s monotone as both ends advanceTwo Pointers
Prefix sums / difference arraysmany range-sum queries, or many range-add updates, all upfrontPrefix Sums
Monotonic stack”nearest greater/smaller”, or a sum over all subarrays’ min/maxMonotonic Stack
Binary search on the answerthe answer is a threshold with a monotone feasibility checkBinary Searchremoves a search dimension,
Ternary / golden-section searchthe objective is unimodal (convex-shaped), not monotoneTernary Search
Coordinate compressionvalues span a huge range but only of them matterSortinglets array-indexed structures replace value-indexed ones

Search-space techniques

TechniqueRecognizesNoteGain
Meet in the middlebrute force over items, split in halfMeet in the Middle
Sqrt decompositionper-operation cost that trades off against block countSqrt Decomposition amortized
Randomized hashing of setscompare multisets/subarrays for equality cheaplyRandomized Algorithms compare, w.h.p. correct

Offline and batching techniques

TechniqueRecognizesNoteGain
Small-to-large mergingmerge sets/maps at tree nodes, total work independent of depthSmall to Large
Sort-and-sweep (offline)events with a natural order, no need to answer onlineOffline Techniquesturns a DS problem into a sort
CDQ divide and conqueran update/query pair ordered in one dimension, interacting in othersCDQremoves one dimension per pass,
Parallel binary search (a.k.a. fracturing search)many queries, each its own binary search over a shared incremental structureParallel Binary Search
Persistenceneed to query an old version of a structure after further updatesPersistence extra per version instead of a full copy

Tree techniques

TechniqueRecognizesNoteGain
Euler tour flatteningsubtree queries, turn them into range queriesEuler Tourlets any array range-query structure handle subtrees
Centroid decompositioncount/aggregate over all paths through each vertexCentroid Decomposition
Virtual tree constructionDP restricted to marked vertices and their pairwise structureVirtual Tree per query
Rerootingneed the answer for every choice of root, not just oneTree DP and Rerooting total
Kruskal reconstruction tree”max edge weight on path” / “min threshold connecting ”, answered onlineKruskal Reconstruction Treeturns the question into an LCA query

Bit techniques

TechniqueRecognizesNoteGain
Submask enumeration / SOS DPneed from values at single bitsSubmasks and SOS DP pairs, or for SOS
XOR basismax/count of XOR-combinations of a vector setXOR Basis, linear algebra over

DP-layered techniques

These sit on top of the DP paradigm, exploiting extra structure (usually convexity) in the transition.

TechniqueRecognizesNoteGain
Digit DPcount numbers in with a digit-local propertyDigit DP
Divide and conquer optimization with the optimal monotone in D&C Optimization
Knuth’s optimizationinterval DP with a quadrangle-inequality costKnuth’s Optimization
Monotone queue optimization, a sliding window of candidatesMonotone Optimizations
Convex hull trick / Li Chao, lines added and queried onlineCHT, Li Chao Tree or
Slope trickthe DP value, as a function of one parameter, stays convex piecewise-linearSlope Trickkeeps the whole function in -per-op heaps instead of recomputing it
Aliens trick / WQS binary search”exactly items” on an answer that’s convex in Aliens Trickremoves the dimension via a penalty + binary search

Proof and design techniques

Not data manipulation tricks — ways of finding and proving a solution, reusable across paradigms.

TechniqueRecognizesNote
Contribution techniquea sum over all pairs/subarrays/subsets, reframed as a sum over elementsContribution
Exchange argumentproving a greedy order is optimal by showing any swap doesn’t helpGreedy and Exchange Arguments