Groups
Category
A sqrt tree is a layered block-decomposition data structure that answers range queries in O(1) time after O(n \log \log n) preprocessing.
The Z-function of a string S computes for each position i the length of the longest substring starting at i that matches the prefix of S.