Table of Contents
Fetching ...

Zip-zip Trees: Making Zip Trees More Balanced, Biased, Compact, or Persistent

Ofek Gila, Michael T. Goodrich, Robert E. Tarjan

TL;DR

The paper introduces zip-zip trees, a simple enhancement of zip trees that removes bias toward small keys by using rank pairs (r1,r2) and lexicographic comparison, while preserving strong history independence and reduced per-node metadata. It proves tight depth and height bounds comparable to treaps and RBSTs, with expected node-depth at most 1.3863 log n and height at most 3.82 log n, and shows per-node metadata is O(log log n) w.h.p., with a just-in-time variant achieving O(1) bits per update. The work also extends to biased zip-zip trees for weighted keys, demonstrates partial persistence with modest space overhead, and provides extensive experimental validation that confirms the theoretical results and practical efficiency. Together, these results yield a space-efficient, balanced, history-independent, and persistable data structure suitable for dynamic and concurrent settings, with potential applications in areas like link-cut trees and planar point-location structures.

Abstract

We define simple variants of zip trees, called zip-zip trees, which provide several advantages over zip trees, including overcoming a bias that favors smaller keys over larger ones. We analyze zip-zip trees theoretically and empirically, showing, e.g., that the expected depth of a node in an $n$-node zip-zip tree is at most $1.3863\log n-1+o(1)$, which matches the expected depth of treaps and binary search trees built by uniformly random insertions. Unlike these other data structures, however, zip-zip trees achieve their bounds using only $O(\log\log n)$ bits of metadata per node, w.h.p., as compared to the $Θ(\log n)$ bits per node required by treaps. In fact, we even describe a ``just-in-time'' zip-zip tree variant, which needs just an expected $O(1)$ number of bits of metadata per node. Moreover, we can define zip-zip trees to be strongly history independent, whereas treaps are generally only weakly history independent. We also introduce \emph{biased zip-zip trees}, which have an explicit bias based on key weights, so the expected depth of a key, $k$, with weight, $w_k$, is $O(\log (W/w_k))$, where $W$ is the weight of all keys in the weighted zip-zip tree. Finally, we show that one can easily make zip-zip trees partially persistent with only $O(n)$ space overhead w.h.p.

Zip-zip Trees: Making Zip Trees More Balanced, Biased, Compact, or Persistent

TL;DR

The paper introduces zip-zip trees, a simple enhancement of zip trees that removes bias toward small keys by using rank pairs (r1,r2) and lexicographic comparison, while preserving strong history independence and reduced per-node metadata. It proves tight depth and height bounds comparable to treaps and RBSTs, with expected node-depth at most 1.3863 log n and height at most 3.82 log n, and shows per-node metadata is O(log log n) w.h.p., with a just-in-time variant achieving O(1) bits per update. The work also extends to biased zip-zip trees for weighted keys, demonstrates partial persistence with modest space overhead, and provides extensive experimental validation that confirms the theoretical results and practical efficiency. Together, these results yield a space-efficient, balanced, history-independent, and persistable data structure suitable for dynamic and concurrent settings, with potential applications in areas like link-cut trees and planar point-location structures.

Abstract

We define simple variants of zip trees, called zip-zip trees, which provide several advantages over zip trees, including overcoming a bias that favors smaller keys over larger ones. We analyze zip-zip trees theoretically and empirically, showing, e.g., that the expected depth of a node in an -node zip-zip tree is at most , which matches the expected depth of treaps and binary search trees built by uniformly random insertions. Unlike these other data structures, however, zip-zip trees achieve their bounds using only bits of metadata per node, w.h.p., as compared to the bits per node required by treaps. In fact, we even describe a ``just-in-time'' zip-zip tree variant, which needs just an expected number of bits of metadata per node. Moreover, we can define zip-zip trees to be strongly history independent, whereas treaps are generally only weakly history independent. We also introduce \emph{biased zip-zip trees}, which have an explicit bias based on key weights, so the expected depth of a key, , with weight, , is , where is the weight of all keys in the weighted zip-zip tree. Finally, we show that one can easily make zip-zip trees partially persistent with only space overhead w.h.p.
Paper Structure (25 sections, 12 theorems, 12 equations, 11 figures)

This paper contains 25 sections, 12 theorems, 12 equations, 11 figures.

Key Result

theorem thmcountertheorem

Let $S$ be a skip list built from $n$ distinct keys. The probability that the height of $S$ is more than $\log n + f(n)$ is at most $2^{-f(n)}$, for any monotonically increasing function $f(n)>0$.

Figures (11)

  • Figure 1: An example skip list.
  • Figure 2: An example zip tree, corresponding to the skip list in \ref{['fig:skip']}.
  • Figure 3: How insertion in a zip tree is done via unzipping and deletion is done via zipping.
  • Figure 4: A zip-zip tree, with each node labeled with its $(r_1,r_2)$ rank. Each shaded subtree is an $r_1$-rank group defining a uniform zip tree based on $r_2$ ranks.
  • Figure 5: How insertion in an external zip tree is done via unzipping and deletion is done via zipping. Comparison nodes are represented with a prime symbol. Analogous to the operation depicted in \ref{['fig:zip']}.
  • ...and 6 more figures

Theorems & Definitions (25)

  • theorem thmcountertheorem
  • proof
  • theorem thmcountertheorem
  • proof
  • lemma thmcounterlemma
  • proof
  • lemma thmcounterlemma
  • proof
  • theorem thmcountertheorem
  • lemma thmcounterlemma
  • ...and 15 more