Persistent Segment Trees: Path Copying for Historical Range Queries

A persistent segment tree maintains a complete history of all structural modifications applied to the data structure. Unlike standard implementations that overwrite previous states, this variant preserves every version, enabling direct queries on historical configurations. The core technique relies on path copying, where only nodes along the mo ...

Posted on Tue, 21 Jul 2026 16:09:02 +0000 by philipolson

Querying Path Sums with Value Constraints in Trees Using Persistent Segment Trees

Problem Overview Given a tree with weighted nodes and multiple queries, each query asks for the sum of node weights along the path between two nodes x and y, where the weights fall within a specified range [l, r]. Solution Approach This problem can be efficiently solved using persistent segment trees (also known as chairman trees) combined with ...

Posted on Fri, 15 May 2026 17:00:54 +0000 by bigbob