Concepts4
๐๏ธData StructureAdvanced
Segment Tree with Range Affine Transformation
A segment tree with lazy propagation can support range updates of the form x โ aยทx + b (affine transformations) and range-sum queries in O(log n) per operation.
#segment tree#lazy propagation#affine update+12
๐๏ธData StructureAdvanced
HLD - Path Queries and Updates
Heavy-Light Decomposition (HLD) breaks a tree into a small number of vertical chains so any path (u,v) becomes O(log n) contiguous segments in an array.
#heavy light decomposition#hld#path query+12
๐๏ธData StructureIntermediate
Iterative Segment Tree
An iterative segment tree stores all leaves in tree[n..2n-1] and internal nodes in tree[1..n-1], enabling O(\log n) point updates and range queries without recursion.
#iterative segment tree#segment tree#non-recursive+12
๐๏ธData StructureIntermediate
Trie (Prefix Tree)
A trie (prefix tree) stores strings or bit-sequences so that common prefixes share nodes, making operations depend on the key length L rather than the set size.
#trie#prefix tree#autocomplete+12