Groups
Category
Level
Mo's algorithm answers many range queries offline by reordering them to minimize pointer movement along the array.
Pick's Theorem connects area and lattice-point counts for any simple polygon with integer-coordinate vertices.
Meet-in-the-middle splits a hard exponential search into two halves, enumerates each half, and then combines results efficiently.
The closest pair of points problem asks for the minimum Euclidean distance between any two points in the plane.
Line sweep (plane sweep) is a technique that processes geometric objects by moving an imaginary line and handling events in sorted order.
The signed area of a simple polygon can be computed in O(n) using the shoelace formula, which sums cross products of consecutive vertices.
Rotating calipers is a geometric two-pointer technique that sweeps two (or more) parallel support lines around a convex polygon.
A line can be represented by two points, a point with a direction vector, or the general form ax + by + c = 0, and these forms are interconvertible.
The convex hull is the smallest convex polygon that contains all given points, like a rubber band snapped around nails on a board.
The minimum rotation of a string is the lexicographically smallest string you can get by cutting it at some position and swapping the two parts.
Point-in-polygon decides whether a point lies outside, inside, or on the boundary of a polygon.
Orientation (CCW test) tells whether three points make a left turn, right turn, or are collinear by using the sign of a 2D cross product.