Segment trees for range queries and updates · 2 of 3 Advanced
Custom combine rules
Decide what a node stores and how two children combine, walk down the tree to find a position, and keep several values per node.
Books1
Links2
- More Applications of Segment Tree Walking down the tree for Hotel Queries and for the k-th element of a set, then combine rules where the order of the two sides matters. usaco.guide (opens in a new tab)
- Segment Tree Variants with a maximum and its count, GCD, the k-th zero found by walking down, and the subarray with the largest sum. cp-algorithms.com (opens in a new tab)