RMQ
RMQ stands for Range Minimum Query. Given an array A of length n, RMQ(i, j) returns the minimum element in the subarray A[i..j], often by returning either the value or the index of the minimum element. Queries are typically assumed to use 0-based indices with i <= j.
Variants of RMQ differentiate whether the array is static or dynamic, whether the minimum value or its
Static RMQ data structures allow fast queries after a preprocessing phase that does not need to handle
Dynamic RMQ supports updates to the array. The standard solution is a segment tree, which provides O(log
RMQ has notable applications, including its use in computing the lowest common ancestor (LCA) of nodes in