TOPICS
Search

Greedy Binary Search Tree


The Greedy binary search tree algorithm, also called Greedy BST, is an algorithm for a sequence of accesses to ordered keys stored in a binary tree. It can be described by plotting each access as a point whose horizontal coordinate is the rank of its key and whose vertical coordinate is its time. Additional points on the same horizontal line represent other keys touched at that time.

Two points that differ in both coordinates are satisfied when the closed axis-aligned rectangle with those opposite corners contains a third point. Greedy processes the accesses in time order. For each unsatisfied rectangle with the current access point at one corner, it adds the other corner on the current horizontal line. Demaine et al. (2009) showed that this rule, called GreedyASS, adds the minimum number of points on that line needed to satisfy the point set so far. It uses only the current access and earlier points, so it is an online algorithm.

When the cost of each search counts distinct keys touched, Lewenstein (2026) reports that for every competitive ratio below 9/4 there are arbitrarily long access sequences on a fixed finite set of keys that exceed that ratio from any initial tree.


See also

Binary Search, Binary Tree, Competitive Ratio, Greedy Algorithm, Online Algorithm

Explore with Wolfram|Alpha

References

Demaine, E. D.; Harmon, D.; Iacono, J.; Kane, D. M.; and Pǎtrascu, M. "The Geometry of Binary Search Trees." In Proceedings of the Twentieth Annual ACM-SIAM Symposium on Discrete Algorithms. Philadelphia, PA: SIAM, pp. 496-505, 2009. https://erikdemaine.org/papers/BST_SODA2009/.Lewenstein, M. "A 9/4 Lower Bound for Greedy Binary Search Trees." 30 Nov 2026. https://arxiv.org/abs/2612.00368.

Cite this as:

Weisstein, Eric W. "Greedy Binary Search Tree." From MathWorld--A Wolfram Resource. https://mathworld.wolfram.com/GreedyBinarySearchTree.html

Subject classifications