Concepts9

⚙️AlgorithmIntermediate

Sweepline Technique

The sweep line technique processes geometric or time-based events in sorted order and maintains an active set that reflects the current state at the sweep position.

#sweep line#plane sweep#active set+12
⚙️AlgorithmIntermediate

State Space Reduction

State space reduction shrinks the number of dynamic programming or search states by keeping only the information that truly affects future decisions.

#state space reduction#dynamic programming#equivalence relation+12
⚙️AlgorithmIntermediate

Offline Query Processing

Offline query processing means you collect all queries first and answer them later in a smart order that makes updates/queries cheap.

#offline query processing#mo's algorithm#fenwick tree+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

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

LIS Variants

LIS variants extend the classic longest increasing subsequence to handle non-decreasing sequences, counting how many LIS exist, and maximizing the sum of a subsequence.

#lis#lnds#patience sorting+12
⚙️AlgorithmIntermediate

Coordinate Compression

Coordinate compression replaces large, sparse, or arbitrary values with small consecutive integers while preserving relative order.

#coordinate compression#discretization#lower_bound+12
🗂️Data StructureIntermediate

Merge Sort Tree

A Merge Sort Tree is a segment tree where every node stores the sorted list of values in its segment.

#merge sort tree#segment tree#range query+12
🗂️Data StructureIntermediate

2D Fenwick Tree

A 2D Fenwick Tree (Binary Indexed Tree) supports point updates and rectangle sum queries in O(log n × log m) time.

#2d fenwick tree#binary indexed tree 2d#bit 2d+12