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.
Sqrt decomposition partitions an array into about \(\sqrt{n}\) blocks, each of size about \(\sqrt{n}\), to speed up range queries and updates.