Optimal Binary Search Trees

Abstract We consider the problem of building optimal binary search trees . The binary search tree is a widely used data structure for information storage and retrieval. A binary search tree T for a set of keys from a total order is a binary tree in which each node has a key value and all the keys of the left subtree are less than the key at the root and all the keys of the right subtree are greater than the key at the root, this property holding recursively for the left and right subtrees of the tree T . Suppose we are given n keys and the probabilities of accessing each key and those occurring in the gap between two successive keys. The optimal binary search tree problem is to construct a binary search tree on these n keys that minimizes the expected access time. One variant of this problem is when only the gaps have nonzero access probabilities, and is called the optimal alphabetic tree problem . Another related problem is when there is no order between the keys and there are probabilities associated only with the gaps and the objective is to build a binary tree with minimum expected weighted path length from the root. This is called the Huffman tree problem . In this survey, we assess known results on the structural properties of the optimal trees, algorithms and lower bounds to construct and to verify optimal trees and heuristics to construct nearly optimal trees and other related results.

[1]  Alfs T. Berztiss,et al.  A taxonomy of binary tree traversals , 1986, BIT.

[2]  Eugene S. Schwartz,et al.  An Optimum Encoding with Minimum Longest Code and Total Number of Digits , 1964, Inf. Control..

[3]  Frank Ruskey,et al.  Generating Binary Trees Lexicographically , 1977, SIAM J. Comput..

[4]  J. Ian Munro,et al.  Self-organizing binary search trees , 1976, 17th Annual Symposium on Foundations of Computer Science (sfcs 1976).

[5]  Eric N. Hanson,et al.  The Interval Skip List: A Data Structure for Finding All Intervals that Overlap a Point , 1991, WADS.

[6]  Joseph C. Culberson,et al.  The effect of updates in binary search trees , 1985, STOC '85.

[7]  Michael L. Fredman,et al.  Weighted Binary Trees for Concurrent Searching , 1996, J. Algorithms.

[8]  Erkki Mäkinen A linear time and space algorithm for finding isomorphic subtrees of a binary tree , 1991 .

[9]  Robert G. Gallager,et al.  Variations on a theme by Huffman , 1978, IEEE Trans. Inf. Theory.

[10]  William H. Burge An Analysis of Binary Search Trees Formed from Sequences of Nondistinct Keys , 1976, JACM.

[11]  Alistair C. Kilgour,et al.  Generalized non‐recursive traversal of binary trees , 1981, Softw. Pract. Exp..

[12]  Arne Andersson A note on searching in a binary search tree , 1991, Softw. Pract. Exp..

[13]  B. John Oommen,et al.  On Using Conditional Rotation Operations to Adaptively Structure Binary Search Trees , 1988, ICDT.

[14]  Alon Itai,et al.  Optimal Alphabetic Trees , 1976, SIAM J. Comput..

[15]  Carlo Blundo,et al.  New bounds on the expected length of one-to-one codes , 1996, IEEE Trans. Inf. Theory.

[16]  Shmuel Tomi Klein,et al.  Bounding the Depth of Search Trees , 1993, Comput. J..

[17]  Ronald C. Read,et al.  Graph theory and computing , 1972 .

[18]  Robert E. Wilber Lower Bounds for Accessing Binary Search Trees with Rotations , 1989, SIAM J. Comput..

[19]  M. R. Kaimal,et al.  Dynamic Optimal Binary Search Tree , 1990, Int. J. Found. Comput. Sci..

[20]  Lawrence L. Larmore A Subquadratic Algorithm for Constructing Approximately Optimal Binary Search Trees , 1987, J. Algorithms.

[21]  Frank Ruskey,et al.  On Rotations and the Generation of Binary Trees , 1993, J. Algorithms.

[22]  Ysmar V. Silva Filho Optimal Choice of Discriminators in a Balanced k-d Binary Search Tree , 1981, Inf. Process. Lett..

[23]  S. Sitharama Iyengar,et al.  Efficient algorithms to globally balance a binary search tree , 1984, CACM.

[24]  Brian Richard Allen On binary search trees. , 1978 .

[25]  Luc Devroye,et al.  A note on the height of binary search trees , 1986, JACM.

[26]  Prakash V. Ramanan Testing the Optimality of Alphabetic Trees , 1992, Theor. Comput. Sci..

[27]  Raymond W. Yeung Alphabetic codes revisited , 1991, IEEE Trans. Inf. Theory.

[28]  Jorma Rissanen Bounds for Weight Balanced Trees , 1973, IBM J. Res. Dev..

[29]  Selim G. Akl,et al.  Efficient Selection on a Binary Tree , 1986, Inf. Process. Lett..

[30]  C. Pandu Rangan,et al.  An Optimal Algorithm for Reconstructing a Binary Tree , 1992, Inf. Process. Lett..

[31]  J. Abrahams Parallelized Huffman and Hu-Tucker searching , 1994, IEEE Trans. Inf. Theory.

[32]  Frank Ruskey,et al.  Binary Tree Gray Codes , 1985, J. Algorithms.

[33]  Eugene S. Schwartz,et al.  Generating a canonical prefix encoding , 1964, CACM.

[34]  A. D. Santis,et al.  Variations on a Theme by Gallager , 1992 .

[35]  Wojciech Rytter,et al.  Sequential and parallel subquadratic work algorithms for constructing approximately optimal binary search trees , 1996, SODA '96.

[36]  Gary D. Knott A balanced tree storage and retrieval algorithm , 1971, SIGIR '71.

[37]  Marvin H. Solomon,et al.  A Note on Enumerating Binary Trees , 1980, JACM.

[38]  Guy Joseph Jacobson,et al.  Succinct static data structures , 1988 .

[39]  T. C. Hu,et al.  BINARY TREES OPTIMUM UNDER VARIOUS CRITERIA , 1979 .

[40]  Jon Louis Bentley,et al.  Multidimensional binary search trees used for associative searching , 1975, CACM.

[41]  Gary D. Knott,et al.  A numbering system for binary trees , 1977, CACM.

[42]  E. F. Moore,et al.  Variable-length binary encodings , 1959 .

[43]  D. S. Hirschberg,et al.  Subtree weight ratios for optimal binary search trees , 1986 .

[44]  M. R. Garey,et al.  Optimal Binary Search Trees with Restricted Maximal Depth , 1974, SIAM J. Comput..

[45]  David G. Kirkpatrick,et al.  Alphabetic Minimax Trees , 1985, SIAM J. Comput..

[46]  Donald E. Knuth,et al.  Dynamic Huffman Coding , 1985, J. Algorithms.

[47]  Eljas Soisalon-Soininen,et al.  Uncoupling updating and rebalancing in chromatic binary search trees , 1991, PODS '91.

[48]  Lawrence L. Larmore,et al.  Constructing Huffman Trees in Parallel , 1995, SIAM J. Comput..

[49]  E. Mäkinen Constructing a binary tree from its traversals , 1989 .

[50]  Raymond W. Yeung Local redundancy and progressive bounds on the redundancy of a Huffman code , 1991, IEEE Trans. Inf. Theory.

[51]  Luc Devroye,et al.  On the Generation of Random Binary Search Trees , 1995, SIAM J. Comput..

[52]  Jean G. Vaucher Pretty‐printing of trees , 1980, Softw. Pract. Exp..

[53]  Bruce A. Reed,et al.  On the Variance of the Height of Random Binary Search Trees , 1995, SIAM J. Comput..

[54]  Kurt Mehlhorn Dynamic Binary Search , 1979, SIAM J. Comput..

[55]  Jean Vuillemin,et al.  A data structure for manipulating priority queues , 1978, CACM.

[56]  Edward M. Reingold,et al.  Binary Search Trees of Bounded Balance , 1973, SIAM J. Comput..

[57]  H. W. Martin,et al.  A random binary tree generator , 1989, CSC '89.

[58]  T. C. Hu,et al.  Combinatorial algorithms , 1982 .

[59]  T. C. Hu,et al.  Optimal Computer Search Trees and Variable-Length Alphabetical Codes , 1971 .

[60]  T. C. Hu,et al.  Path Length of Binary Search Trees. , 1972 .

[61]  Dominique Roelants van Baronaigien A Loopless Algorithm for Generating Binary Tree Sequences , 1991, Inf. Process. Lett..

[62]  Yasuichi Horibe An Improved Bound for Weight-Balanced Tree , 1977, Inf. Control..

[63]  Jürg Nievergelt,et al.  Binary Search Trees and File Organization , 1974, CSUR.

[64]  T. C. Hu A New Proof of the T-C Algorithm , 1973 .

[65]  Stephan Olariu,et al.  An Optimal Parallel Algorithm to Reconstruct a Binary Tree from its Traversals , 1991, ICCI.

[66]  Thomas E. Gerasch,et al.  An insertion algorithm for a minimal internal path length binary search tree , 1988, CACM.

[67]  F. Frances Yao,et al.  Efficient dynamic programming using quadrangle inequalities , 1980, STOC '80.

[68]  Lawrence L. Larmore Length limited coding and optimal height-limited binary trees , 1988 .

[69]  Edgar N. Gilbert,et al.  Codes based on inaccurate source probabilities , 1971, IEEE Trans. Inf. Theory.

[70]  Derick Wood,et al.  How to Update a Balanced Binary Tree with a Constant Number of Rotations , 1990, SWAT.

[71]  Lawrence L. Larmore,et al.  A fast algorithm for optimal length-limited Huffman codes , 1990, JACM.

[72]  H. T. Kung,et al.  Concurrent manipulation of binary search trees , 1980, TODS.

[73]  J. Ian Munro,et al.  The Analysis of a Fringe Heuristic for Binary Search Trees , 1985, J. Algorithms.

[74]  Chak-Kuen Wong,et al.  Upper Bounds for the Total Path Length of Binary Trees , 1973, JACM.

[75]  Alfred V. Aho,et al.  Data Structures and Algorithms , 1983 .

[76]  Donald E. Knuth,et al.  Sorting and Searching , 1973 .

[77]  Brendan Mumey,et al.  Upper and lower bounds on constructing alphabetic binary trees , 1993, SODA '93.

[78]  Alfredo De Santis,et al.  On the Redundancy Achieved by Huffman Codes , 1996, Inf. Sci..

[79]  Jean Marcel Pallo,et al.  Enumerating, Ranking and Unranking Binary Trees , 1986, Comput. J..

[80]  Edward N. Adams Another Representation of Binary Tree Traversal , 1973, Inf. Process. Lett..

[81]  Andrzej Proskurowski On the Generation of Binary Trees , 1980, JACM.

[82]  Solomon W. Golomb Sources Which Maximize the Choice of a Huffman Coding Tree , 1980, Inf. Control..

[83]  Theo P. van der Weide,et al.  Hairy Search Trees , 1995, Comput. J..

[84]  Brent M. Troutman,et al.  A Note on Subtrees Rooted Along the Primary Path of a Binary Tree , 1993, Discret. Appl. Math..

[85]  Thomas N. Hibbard,et al.  Some Combinatorial Properties of Certain Trees With Applications to Searching and Sorting , 1962, JACM.

[86]  Jehoshua Bruck,et al.  Polynomial threshold functions, AC functions and spectrum norms , 1990, Proceedings [1990] 31st Annual Symposium on Foundations of Computer Science.

[87]  Robert E. Tarjan,et al.  Self-adjusting binary search trees , 1985, JACM.

[88]  Rainer Kemp Binary Search Trees Constructed from Nondistinct Keys with/without Specified Probabilities , 1996, Theor. Comput. Sci..

[89]  M. AdelsonVelskii,et al.  AN ALGORITHM FOR THE ORGANIZATION OF INFORMATION , 1963 .

[90]  J. Yohe Algorithm 428: Hu-Tucker minimum redundancy alphabetic coding method [Z] , 1972, CACM.

[91]  Adriano M. Garsia,et al.  A New Algorithm for Minimum Cost Binary Trees , 1977, SIAM J. Comput..

[92]  Lawrence L. Larmore,et al.  A Parallel Algorithm for Optimum Height-Limited Alphabetic Binary Trees , 1996, J. Parallel Distributed Comput..

[93]  Jim Bell,et al.  An evaluation of self‐adjusting binary search tree techniques , 1993, Softw. Pract. Exp..

[94]  Samuel H. Fuller,et al.  Performance of height-balanced trees , 1976, CACM.

[95]  Stuart H. Zweben,et al.  An optimal insertion algorithm for one-sided height-balanced binary search trees , 1979, CACM.

[96]  Lawrence L. Larmore,et al.  The Optimal Alphabetic Tree Problem Revisited , 1994, ICALP.

[97]  Priti Shankar,et al.  A Note on the Reconstruction of a Binary Tree from its Traversals , 1992, Inf. Process. Lett..

[98]  David Gries,et al.  Inorder traversal of a binary tree and its inversion , 1989 .

[99]  Maria M. Klawe,et al.  Alphabetic Minimax Trees of Degree at Most t , 1986, SIAM J. Comput..

[100]  Walter Cunto,et al.  Improving time and space efficiency in generalized binary search trees , 1987, Acta Informatica.

[101]  Alfredo De Santis,et al.  New Lower Bounds on the Cost of Binary Search Trees , 1996, Theor. Comput. Sci..

[102]  Rudolf Ahlswede,et al.  Search Problems , 1987 .

[103]  Alfredo De Santis,et al.  Tight Upper and Lower Bounds on the Path Length of Binary Trees , 1994, SIAM J. Comput..

[104]  J. H. Hester,et al.  Generation of optimal binary split trees , 1985 .

[105]  Inder Jeet Taneja,et al.  Bounds on the redundancy of Huffman codes , 1986, IEEE Trans. Inf. Theory.

[106]  Jeffrey H. Kingston A New Proof of the Garsia-Wachs Algorithm , 1988, J. Algorithms.

[107]  Stephan Olariu,et al.  Reconstructing a Binary Tree from its Traversals in Doubly , 1995, J. Parallel Distributed Comput..

[108]  Gen-Huey Chen,et al.  Two Algorithms for Constructing a Binary Tree from its Traversals , 1988, Inf. Process. Lett..

[109]  Giuseppe Persiano,et al.  Minimal path length of trees with known fringe , 1995 .

[110]  S. Sitharama Iyengar,et al.  Derivation of a Maximally Parallel Algorithm for Balancing Binary Search Trees , 1984 .

[111]  William E. Wright,et al.  Probabilities Related to Father-Son Distances in Binary Search Trees , 1986, SIAM J. Comput..

[112]  J. Van Leeuwen,et al.  Handbook of theoretical computer science - Part A: Algorithms and complexity; Part B: Formal models and semantics , 1990 .

[113]  Derick Wood,et al.  Adaptive heuristics for binary search trees and constant linkage cost , 1991, SODA '91.

[114]  J. Ian Munro,et al.  A discipline for robustness or storage reduction in binary search trees , 1983, PODS '83.

[115]  Edsger W. Dijkstra,et al.  Formal Development of Programs and Proofs , 1990 .

[116]  Gyula O. H. Katona,et al.  Huffman codes and self-information , 1976, IEEE Trans. Inf. Theory.

[117]  T. Fenner,et al.  A study of binary tree traversal algorithms and a tag-free threaded representation , 1986 .

[118]  Giuseppe Persiano,et al.  Characteristic Inequalities for Binary Trees , 1995, Inf. Process. Lett..

[119]  Kurt Mehlhorn,et al.  A Best Possible Bound for the Weighted Path Length of Binary Search Trees , 1977, SIAM J. Comput..

[120]  D. Huffman A Method for the Construction of Minimum-Redundancy Codes , 1952 .

[121]  Jörg-Rüdiger Sack,et al.  Heuristics for Optimum Binary Search Trees and Minimum Weight Triangulation Problems , 1989, Theor. Comput. Sci..

[122]  Derick Wood,et al.  On the path length of binary trees , 1989, JACM.

[123]  Anthony E. Trojanowski Ranking and Listing Algorithms for k-ary Trees , 1978, SIAM J. Comput..

[124]  Donald Ervin Knuth,et al.  The Art of Computer Programming , 1968 .

[125]  M. C. Er A New Algorithm for Generating Binary Trees Using Rotations , 1989, Comput. J..

[126]  Alfredo De Santis,et al.  A note on D-ary Huffman codes , 1991, IEEE Trans. Inf. Theory.

[127]  J. Ian Munro,et al.  Fault Tolerance and Storage Reduction in Binary Search Trees , 1984, Inf. Control..

[128]  Frances F. Yao,et al.  Speed-Up in Dynamic Programming , 1982 .

[129]  C. C. Gotlieb,et al.  A TOP-DOWN ALGORITHM FOR CONSTRUCTING NEARLY OPTIMAL LEXICOGRAPHIC TREES , 1972 .

[130]  Martin Aigner Combinatorial search , 1988 .

[131]  Teruo Hikita Listing and Counting Subtrees of Equal Size of a Binary Tree , 1983, Inf. Process. Lett..

[132]  Erkki Mäkinen,et al.  Left distance binary tree representations , 1987, BIT.

[133]  Alfredo De Santis,et al.  On Binary Search Trees , 1993, Inf. Process. Lett..

[134]  M. Garey Optimal Binary Identification Procedures , 1972 .

[135]  Russell L. Wessner Optimal Alphabetic Search Trees With Restricted Maximal Height , 1976, Inf. Process. Lett..