Concepts2
🗂️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 StructureAdvanced
Segment Tree - Handling Multiple Lazy Operations
When a segment tree supports multiple range updates, you must define how lazy tags compose, because the order of operations matters and composition is not commutative.
#segment tree#lazy propagation#range add+12