Why it matters
Persistent structures enable powerful historical queries.
Advertisement
The architecture
Path copying: only nodes on modified path copied.
New root per version.
Advertisement
How it works end to end
k-th smallest in range: build persistent segment tree per position.
Offline algorithms: sort queries + build persistent.