Concepts2
🗂️Data StructureAdvanced
Sqrt Tree
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 tree#range query#associative operation+11
⚙️AlgorithmIntermediate
LCA - Binary Lifting
Binary lifting precomputes 2^k ancestors for every node so we can jump upward in powers of two.
#lca#binary lifting#tree+12