Partially persistent BST: fat nodes

Idea:
  • instead of copying nodes (as path copying does), keep every node forever and make its pointers versioned: a "fat" node stores, for each child slot, the full history of pointers ever written into it, each stamped with the version that wrote it
  • when reading version \(v\), we need to find the last update before \(v\), i.e. the largest version stamp \(\le v\)
  • an update writes \(O(1)\) new pointer entries and never erases old ones — deletion just writes a null pointer (a tombstone) or redirects a pointer past the deleted node
Advantages:
  • only \(O(1)\) space per update — no copies at all
Disadvantages:
  • searching is slower; when a node has \(m\) updates, it takes \(O(\log m)\) time to find a given version
  • partial persistence only: old versions cannot be branched, unlike path copying

References

  • J.R. Driscoll, N. Sarnak, D.D. Sleator, R.E. Tarjan. Making data structures persistent. Journal of Computer and System Sciences, 38(1):86-124, 1989.