On the Number of Descendants and Ascendants in Random Search Trees

The number of descendants of a node in a binary search tree (BST) is the size of the subtree having this node as a root; the number of ascendants is the number of nodes on the path connecting this node with the root. Using a purely combinatorial approach (generating functions and differential equations) we are able to extend previous results. For the number of descendants we get explicit formulae for all moments; for the number of ascendants, which is harder, we get the variance. A natural extension of binary search trees occurs when performing local reorganisations. Poblete and Munro have already analyzed some aspects of these locally balanced binary search trees (LBSTs). Here, we relate these structures with the performance of median–of–three Quicksort. We get as new results the variances for ascendants and descendants in this setting. If the rank of the node itself is picked at random ("grand averages"), the corresponding parameters only depend on the size $n$. In this instance, we get all the moments for the descendants (BST and LBST), as well as the probabilities. For ascendants (LBST), we get the variance and (in principle) the higher moments, as well as the (normal) limiting distribution. The emphasis is on explicit formulae, and these are sometimes quite involved. Thus, in some instances, we have decided to state abridged versions in the paper and collect the long forms into an appendix that can be downloaded from the URLs http://info.tuwien.ac.at/theoinf/abstract/abs_120.htm and http://www.lsi.upc.es/~conrado/research/ .

[1]  H. Wilf generatingfunctionology: Third Edition , 1990 .

[2]  William C. Lynch,et al.  More Combinatorial Properties of Certain Trees , 1965, Comput. J..

[3]  Bruno Salvy,et al.  GFUN: a Maple package for the manipulation of generating and holonomic functions in one variable , 1994, TOMS.

[4]  Donald E. Knuth,et al.  The Art of Computer Programming: Volume 3: Sorting and Searching , 1998 .

[5]  Hsien-Kuei Hwang,et al.  Théorèmes limites pour les structures combinatoires et les fonctions arithmétiques , 1994 .

[6]  Helmut Prodinger,et al.  Comparisons in Hoare's Find Algorithm , 1998, Combinatorics, Probability and Computing.

[7]  Gerald G. Brown,et al.  On Random Binary Trees , 1984, Math. Oper. Res..

[8]  G. H. Gonnet,et al.  Handbook of algorithms and data structures: in Pascal and C (2nd ed.) , 1991 .

[9]  Ronald L. Graham,et al.  Concrete mathematics - a foundation for computer science , 1991 .

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

[11]  P. Gács,et al.  Algorithms , 1992 .

[12]  H. Prodinger,et al.  Analysis of Hoare's FIND algorithm with median-of-three partition , 1997 .

[13]  Cecilia R. Aragon,et al.  Randomized search trees , 1989, 30th Annual Symposium on Foundations of Computer Science.

[14]  Donald E. Knuth,et al.  Mathematical Analysis of Algorithms , 1971, IFIP Congress.

[15]  S. R. Arora,et al.  Randomized binary search technique , 1969, CACM.

[16]  Guy Louchard Exact and Asymptotic Distributions in Digital and Binary Search Trees , 1987, RAIRO Theor. Informatics Appl..

[17]  Derick Wood,et al.  Locally Balanced Binary Trees , 1976, Comput. J..

[18]  Alois Panholzer,et al.  Untersuchungen zur durchschnittlichen Gestalt gewisser Baumfamilien: mit besonderer Berücksichtigung von Anwendungen in der Informatik , 1999 .

[19]  Conrado Martínez,et al.  Randomization of Search Trees by Subtree Size , 1996, ESA.

[20]  Philippe Flajolet,et al.  Average-Case Analysis of Algorithms and Data Structures , 1991, Handbook of Theoretical Computer Science, Volume A: Algorithms and Complexity.

[21]  E. Kamke Differentialgleichungen : Lösungsmethoden und Lösungen , 1977 .

[22]  Philippe Flajolet,et al.  General combinatorial schemas: Gaussian limit distributions and exponential tails , 1993, Discret. Math..

[23]  Helmut Prodinger,et al.  Analysis of Hoare's FIND algorithm with Median-of-three partition , 1997, Random Struct. Algorithms.

[24]  Hosam M. Mahmoud,et al.  Evolution of random search trees , 1991, Wiley-Interscience series in discrete mathematics and optimization.

[25]  Leonidas J. Guibas,et al.  A dichromatic framework for balanced trees , 1978, 19th Annual Symposium on Foundations of Computer Science (sfcs 1978).

[26]  Philippe Flajolet,et al.  An introduction to the analysis of algorithms , 1995 .

[27]  Philippe Flajolet,et al.  The Average Case Analysis of Algorithms : Multivariate Asymptotics and Limit Distributions , 1997 .

[28]  Donald E. Knuth,et al.  The art of computer programming: sorting and searching (volume 3) , 1973 .

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

[30]  Philippe Flajolet,et al.  Page usage in a quadtree index , 1992, BIT Comput. Sci. Sect..

[31]  Philippe Flajolet,et al.  Singularity Analysis of Generating Functions , 1990, SIAM J. Discret. Math..

[32]  Robert Sedgewick,et al.  Algorithms in C , 1990 .