Why it matters

Persistent segtree enables versioned queries. Understanding shapes advanced structures.

Advertisement

The architecture

New version = updated path from root.

Share unchanged subtrees.

Log n new nodes per update.

Persistent segtreeUpdatelog n new nodesShare unchangedpath copyQuery any versionlog n accessPersistent structures pioneered by Sarnak + Tarjan; competitive prog standard
Persistent segtree.
Advertisement

How it works end to end

Sarnak + Tarjan 1986.

Path-copying persistence.

Applications: 2D queries + offline problems.