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

Chapter 26Tango trees

No online BST algorithm is known to be dynamically optimal. Tango trees (Demaine et al. 2007), first presented at FOCS 2004, were the first online BST proved to be O(log⁡log⁡n)O(\log\log n)-competitive. They fix a balanced reference tree on the keys and follow its preferred paths: each reference node prefers the side of its subtree where the latest request in that subtree fell. The number of preference changes is Wilber’s interleave quantity, a lower bound on every execution (Chapter 17), and a Tango tree pays O(log⁡log⁡n)O(\log\log n) per change.

  • Section 26.1 proves the counting identity: preference changes are the interleave quantity, plus at most nn first settings.
  • Section 26.2 builds the BST. It stores each preferred path as an auxiliary tree inside one binary search tree, defines the online policy, and proves that its cost is within a factor O(log⁡log⁡n)O(\log\log n) of every offline execution from the same initial tree, plus a startup term of order nlog⁡log⁡nn\log\log n.
  • Section 26.3 applies the preference updates of each request from the bottom of the search path upward, which brings the startup term down to O(n)O(n). Chapter 31 needs this version. The library states the result as one online algorithm, Results.exists_competitive_linear.