e01.org

Zip tree

The zip tree was introduced as a variant of random binary search tree by Robert Tarjan, Caleb Levy, and Stephen Timmel. Zip trees are similar to max treaps except ranks are generated through a geometric distribution and maintain their max-heap property during insertions and deletions through unzipping and zipping rather than tree rotations. Nodes of the tree contain a distinct, comparable key and a numeric rank. The tree is max heap ordered with respect to the ranks with ties broken in favor of smaller keys. Nodes of the tree must contain distinct keys but allow for duplicate ranks. The rank tie-breaker favoring smaller keys creates a bias in the tree favoring smaller nodes. A slightly modified zip tree variant, zip-zip trees address this bias by introducing a different tie-breaker with a second rank.

The zip tree was introduced as a variant of random binary search tree by Robert Tarjan, Caleb Levy, and Stephen Timmel. Zip trees are similar to max treaps except ranks are generated through a geometric distribution and maintain their max-heap property during insertions and deletions through unzipping and zipping rather than tree rotations. Nodes of the tree contain a distinct, comparable key and a numeric rank. The tree is max heap ordered with respect to the ranks with ties broken in favor of smaller keys. Nodes of the tree must contain distinct keys but allow for duplicate ranks. The rank tie-breaker favoring smaller keys creates a bias in the tree favoring smaller nodes. A slightly modified zip tree variant, zip-zip trees address this bias by introducing a different tie-breaker with a second rank. Then, follow the search path for x in the tree until finding a node u such that u.rank x.key. Keys must be unique so if at any point v.key = x.key, the search stops and no new node is inserted. Once the search for x is complete, x is inserted in place of the node u. The top node of the path P becomes the left child of x and the top node of Q becomes the right child. The parent and child pointers between u and u.parent will be updated accordingly with x, and if u was previously the root node, x becomes the new root.

References

  1. ^ Gila, Ofek; Goodrich, Michael T.; Tarjan, Robert E. (2023). "Zip-Zip Trees: Making Zip Trees More Balanced, Biased, Compact, or Persistent". In Morin, Pat; Suri, Subhash (eds.). Algorithms and Data Structures . Lecture Notes in Computer Science. Vol. 14079. Cham: Springer Nature Switzerland. pp. 474– 492. arXiv : 2307.07660 . doi : 10.1007/978-3-031-38906-1_31 . ISBN 978-3-031-38906-1 . Wikipedia revision 1311791948, retrieved 2026-11-19 · 1795042800.0
  2. ^ a b Tarjan, Robert E.; Levy, Caleb C.; Timmel, Stephen (2021-10-31). "Zip Trees". ACM Transactions on Algorithms . 17 (4): 1– 12. arXiv : 1806.06726 . doi : 10.1145/3476830 . ISSN 1549-6325 . Wikipedia revision 1311791948, retrieved 2026-11-19 · 1795042800.0
source: e01 Encyclopedia · licence: CC BY-SA 4.0 · page · source revision

Cite this

"Zip tree". 1758056404. e01 Encyclopedia. CC BY-SA 4.0. https://en.wikipedia.org/w/index.php?oldid=1311791948

JSON record · API collection · BibTeX · RIS · CSL-JSON · citation policy

Save to pass ·