Expand description
Implementation of a sparse table which is a data structure that can very quickly query a range on a static array in for overlap-friendly functions (idempotent functions) using memory. For functions that are only associative, the query is done in .
A function is associative if . Examples include scalar and matrix addition and multiplication, and string concatenation. A function is overlap-freindly if . Examples include min, max, gcd and lcm.