Partially persistent BST: node copying

Idea:
  • the node-copying method combines the strengths of fat nodes (cheap updates) and path copying (cheap reads): every node carries its two original child pointers plus a bounded table of extra version-stamped pointers
  • an update first tries the cheap move: write one extra pointer into the changed node's table — \(O(1)\), no copying
  • only when the table is full is the node copied: the copy starts with the currently live pointers as its originals (and an empty table), and the parent must now point at the copy — the same step one level up, so a full parent cascades further, exactly like path copying
Advantages:
  • \(O(1)\) amortized space per update and \(O(1)\) time per pointer access — the best of both simpler methods
Disadvantages:
  • partial persistence: only the newest version can be updated

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.