Groups
Category
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.
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.