Segment Tree

Problems on segment trees, including sums, minimums and maximums on a segment with updates, lazy propagation for range assignment and addition, counting elements on a segment, merge sort trees and persistent segment trees.

The prefix sums article in the Basics section covers the case without updates. Related problem sets are under Fenwick tree, Range queries and Data structures.

Problems