Segment Tree with Lazy Propagation for Range Updates

Consider an array of (n) integers (a_1, a_2, \cdots, a_n). Two types of operations are supported: Add a value (d) to all elements from index (l) to (r). Query the maximum element within the range ([l, r]). To efficiently handle these operations, we use a segment tree enhanced with lazy propagation. This technique introduces a lazy tag to defe ...

Posted on Fri, 08 May 2026 08:30:24 +0000 by Zaxnyd