Persistent Data Structures
A persistent data structure preserves previous versions after an update, allowing old and new versions to coexist. Efficient implementations usually use structural sharing: instead of copying the entire structure, only nodes along the modified path are copied while unchanged nodes are shared between versions.
Previous versions remain accessible.
Structural sharing reduces copying.
Useful for undo systems and immutable state.
Persistent trees can create a new root for every version.
Typical update cost depends on the underlying structure.