Concepts2
🗂️Data StructureAdvanced
Segment Tree Beats
Segment Tree Beats is a segment tree variant that supports range chmin/chmax (clamping) together with queries like range sum, min, and max in amortized logarithmic time.
#segment tree beats#range chmin#range chmax+12
🗂️Data StructureIntermediate
Fenwick Tree (Binary Indexed Tree)
A Fenwick Tree (Binary Indexed Tree) maintains prefix sums so you can update a single position and query a prefix in O(\log n) time with a tiny constant factor.
#fenwick tree#binary indexed tree#prefix sum+11