An exploration of implicit in-order forests (segment trees) extended to support efficient range updates. The standard structure supports O(log N) range queries but requires O(N) range updates. By doubling each node to store both an aggregate value (A) and a regular value (R) that propagates downward, range updates can be performed in O(log² N) time at the cost of 2x memory. The operation must be associative, commutative, and idempotent (a bounded meet-semilattice). The author implemented this in Rust as part of the Fidget project and validated correctness using proptest property-based testing. This is equivalent to a segment tree with lazy propagation.

7m read timeFrom mattkeeter.com
Post cover image
Table of contents
Updates

Sort: