Segment Trees for Range Queries
Answer "what is the min, max or sum of this range?" and update a value, both in O(log n), on an array that keeps changing.
11 min readUpdated 2026-09-03segment-treerange-querytree
Answer "what is the min, max or sum of this range?" and update a value, both in O(log n), on an array that keeps changing.