Module sqrt_decomp

Source

Structs§

DistinctVals

Traits§

MoState
A generic implementation of Mo’s algorithm, aka Query Sqrt Decomposition. It answers q offline queries over intervals in 0..n by shifting the query interval’s endpoints by one position at a time. Each endpoint incurs a total cost of at most n * sqrt(q * L_OP * R_OP).