(Un)expected path lengths of asymmetric binary search trees
The average path length over the family of binary search trees with 2r+1 nodes, built from randomly choosen permutations of r distinct keys, is O(rlog(r)). On the other hand, if the probability that the r keys are already sorted, tends towards 1, the resulting family of binary search trees degenerates, until it consists of the single linear list — tree with a worst case path length of r(r + 1).
Subject of the paper is the gap between the orders of growth of the expected path lengths of these two models. We systematically deform the probability model of binary search trees using three different kinds of deformers which are controlled by a real constant c and, using singularity analysis, we obtain the surprising result, that under two deformations the expected path length of a tree of size 2r + 1 is either O(r log(r)) or O(r 2).The same result is valid under the third deformation for special values of c.
KeywordAlgorithms and Data Structures
- Abramowitz, M., Stegun, I.A.: Handbook of Mathematical Functions. New York: Dover Publications, (1970)Google Scholar
- Casas, R., Díaz, J., Martínez, C.: Average-case Analysis on Simple Families of Trees Using a Balanced Probability Model. Series Formelles Et Combinatoire Algebrique, Actes de Colloque, 133–143, Bordeaux, (2.–4. Mai 1991)Google Scholar
- Graham, R.L., Knuth, D.E., Patashnik, O.: Concrete Mathematics. Addison-Wesley, Reading, Mass., (1988)Google Scholar
- Henrici, P.: Applied and Computational Complex Analysis, Vol. 2. Wiley Interscience, New York, (1977)Google Scholar
- Kamke, E.: Differentialgleichungen. Akademische Verlagsgesellschaft Geest & Portig K.-G., Leipzig, (1967)Google Scholar
- Kemp, R.: Additive Weights of Non-Regularly Distributed Trees. Annals of Discrete Mathematics 33, 129–155, (1987)Google Scholar
- Knuth, D.E.: The Art of Computer Programming, Vol. 1, (2nd ed.). Addison-Wesley, Reading, Mass., (1973)Google Scholar
- Meir, A., Moon, J.W.: On the Altitude of Nodes in Random Trees. Can. J. Math. 30, 997–1015, (1978)Google Scholar
- Trier, U.: Additive Weights Under the Balanced Probability Model. Johann Wolfgang Goethe Universität Frankfurt, Fachbereich Informatik (20), Preprint, (1992)Google Scholar
- Wasow, W.: Asymptotic Expansions for Ordinary Differential Equations. Wiley Inter-science, New York, (1965)Google Scholar