Concepts116

⚙️AlgorithmAdvanced

Mo's Algorithm - With Updates

Mo's algorithm with updates treats array modifications as a third dimension called time and answers range queries on the correct version of the array.

#mo's algorithm with updates#time dimension#offline range queries+11
⚙️AlgorithmAdvanced

Half-Plane Intersection

Half-plane intersection (HPI) computes the common region that satisfies many linear side-of-line constraints in the plane.

#half-plane intersection#computational geometry#convex polygon+12
⚙️AlgorithmAdvanced

Minkowski Sum

The Minkowski sum A ⊕ B adds every point of set A to every point of set B, and for convex polygons it can be computed in O(n + m) by merging edge directions.

#minkowski sum#convex polygon#edge merge+12
⚙️AlgorithmAdvanced

DSU on Tree (Sack)

DSU on Tree (also called the Sack technique) answers many subtree queries in O(n \log n) by keeping data from the heavy child and temporarily re-adding light subtrees.

#dsu on tree#sack technique#subtree queries+12
⚙️AlgorithmIntermediate

Small-to-Large Merging

Small-to-large merging is a technique where you always merge the smaller container into the larger one to guarantee low total work.

#small-to-large merging#dsu on tree#sack technique+11
⚙️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
⚙️AlgorithmAdvanced

Rectangle Union Area

The union area of many axis-aligned rectangles can be computed efficiently using a sweep line over x and a segment tree tracking covered y-length.

#rectangle union area#line sweep#segment tree+12
⚙️AlgorithmIntermediate

Pick's Theorem

Pick's Theorem connects area and lattice-point counts for any simple polygon with integer-coordinate vertices.

#pick's theorem#lattice polygon#shoelace formula+12
⚙️AlgorithmIntermediate

Meet in the Middle

Meet-in-the-middle splits a hard exponential search into two halves, enumerates each half, and then combines results efficiently.

#meet in the middle#subset sum#pair sums+12
⚙️AlgorithmIntermediate

Closest Pair of Points

The closest pair of points problem asks for the minimum Euclidean distance between any two points in the plane.

#closest pair of points#divide and conquer#plane sweep+11
⚙️AlgorithmIntermediate

Line Sweep

Line sweep (plane sweep) is a technique that processes geometric objects by moving an imaginary line and handling events in sorted order.

#line sweep#plane sweep#event queue+12
⚙️AlgorithmIntermediate

Polygon Area and Centroid

The signed area of a simple polygon can be computed in O(n) using the shoelace formula, which sums cross products of consecutive vertices.

#shoelace formula#polygon area#centroid+12