Groups
Category
An invariant is a property you promise to keep true throughout an algorithm, and it is the anchor of both design and correctness proofs.
Mo's algorithm answers many range queries offline by reordering them to minimize pointer movement along the array.