Binary Search Trees in Lean Check a result Declarations Bibliography Lean source

Part II · Bounds · NotesBibliographic notes

The benchmarks of this part come from the analysis of splay trees and from the search for lower bounds on the offline optimum. These notes give their origins and the main results about them that the book does not formalize. The surveys of Iacono (2013) and Bose et al. (2013) cover the adaptive bounds in more detail, and Chalermsook et al. (2016) map many of their relations.

Adaptive bounds

The working-set, static optimality and static finger bounds of Chapter 14, and the fixed-finger version of the unified bound, are the theorems of the splay tree paper (Sleator and Tarjan 1985). The entropy lower bound for a fixed tree, which gives static optimality its meaning, goes back to the analysis of nearly optimal trees (Mehlhorn 1975). Iacono (2001) showed that the working-set bound implies static optimality and the static finger bound. Iacono (2005) introduced key-independent optimality, the expected optimal cost when the keys are relabelled at random, and showed that it is equivalent to the working-set bound.

The dynamic finger bound for splay trees is the theorem of Cole et al. (2000) and Cole (2000). The working-set and dynamic finger bounds are incomparable. Iacono’s unified bound combines them: a request is cheap if it is close in rank to a recently requested key (Iacono 2001; Bădoiu et al. 2007). It holds for some data structures that are not BSTs, and it is open whether any BST achieves it. Skip-splay trees (Derryberry and Sleator 2009) and layered working-set trees (Bose et al. 2012b) come within additive terms, and the group access bounds of Chalermsook et al. (2024a) give another route to the same additive guarantee. Variants of the property include the fresh-finger property of Howat et al. (2013) and the multi-finger bounds of Chalermsook et al. (2018). The queueish property of priority queues (Iacono and Langerman 2005) is the opposite of the working-set bound: there, an item is cheap to extract if few of the items still present were inserted before it.

The lazy finger and the weighted dynamic finger

The lazy finger of Chapter 15 is due to Bose et al. (2016). They showed that, unlike the root finger, its optimum is not described by an entropy, derived an asymptotically tight expression for it, and computed the optimal tree by dynamic programming. Expressed with weights on the keys, this cost is the weighted dynamic finger bound, the name used by Iacono and Langerman (2016), who showed that GreedyASS meets it. Section 25.3 formalizes their proof. The comparison of Chapter 16 between lazy-finger trees, root-finger trees and dynamic BSTs is Theorem 6 of Bose et al. (2016). Chalermsook et al. (2016) extend the lazy finger to several fingers and obtain a hierarchy of bounds, including a tight O(nlog⁡d)O(n \log d) bound for GreedyASS on dd-decomposable sequences, which Goyal and Gupta (2019) proved independently with a new lower-bound certificate.

Lower bounds

Wilber (1989) gave two lower bounds on the offline optimum, first at FOCS 1986. The first, the interleave or alternation bound, is the subject of Chapter 17 and the basis of Tango trees. The second, the funnel bound, is not formalized. Fredman (2011) extended the first bound to trees that are not ordered.

The geometric view gave further lower bounds. Demaine et al. (2009) introduced the independent rectangle bound and showed that it equals, up to constant factors, the cost of a greedy algorithm run on one side of the diagonal at a time (SIGNED Greedy). Derryberry et al. (2005) found a closely related framework independently. The independent rectangle bound subsumes both bounds of Wilber.

Recent work compares these bounds. Lecomte and Weinstein (2020) showed that the funnel bound is always at least the interleave bound up to constant factors, and that the gap can be Θ(log⁡log⁡n)\Theta(\log\log n). Chalermsook et al. (2023a) showed that even the best interleave bound over all reference trees can be smaller than the offline optimum by a factor Ω(log⁡log⁡n/log⁡log⁡log⁡n)\Omega(\log\log n / \log\log\log n). Jiang et al. (2024) proved direct-sum theorems for both bounds of Wilber, and concluded that Tango trees are optimal among the algorithms whose cost is charged to the interleave bound. An analysis that charges an algorithm’s cost to the interleave bound therefore cannot prove a competitive ratio much below log⁡log⁡n\log\log n.

No polynomial-time algorithm is known that computes the offline optimum within a constant factor. Chalermsook et al. (2023a) give a constant-factor approximation in subexponential time.

Conditional entropy

The conditional-entropy benchmark of Chapter 18, the proof that no BST meets it (Lemma 7), and the multiple-tree structure that meets it within a factor log⁡n/log⁡c\log n / \log c with O(nc)O(nc) words of space (Theorem 9) are from Bose et al. (2016). The bit-reversal sequence used in the proof is Wilber’s standard hard example (Wilber 1989).

Several families of sequences are known to be easy for the offline optimum, and serve as tests for candidate algorithms. Chalermsook et al. (2015b) conjectured that the optimum is linear on sequences that avoid a fixed permutation pattern, and Berendsohn et al. (2024) proved it: the amortized optimum is O(1)O(1) per request on such sequences. No online algorithm is known to achieve this. Pattern-avoiding sequences can also be sorted in linear time (Opler 2024). The traversal, deque and split conjectures of the algorithms’ notes are special cases of the same question.

Other models change the benchmark. Lazy search trees (Sandlund and Wild 2020) charge only for the order information that the queries need. Learning-augmented search trees use predictions of the access frequencies (Lin et al. 2022). Skip lists and B-trees have their own versions of dynamic optimality (Bose et al. 2008; Demaine et al. 2021).