Why it matters

Persistent structures enable powerful historical queries.

Advertisement

The architecture

Path copying: only nodes on modified path copied.

New root per version.

Persistent segment treePath copyingmodified nodes onlyOld nodes sharedstructural sharingMultiple rootsone per versionHistorical queries + interval problems + rollback
Persistence approach.
Advertisement

How it works end to end

k-th smallest in range: build persistent segment tree per position.

Offline algorithms: sort queries + build persistent.