Abstract

The height of a tree with n nodes, that is the number of nodes on a maximal simple path starting at the root, is of interest in computing because it represents the maximum size of the stack used in algorithms that traverse the tree. In the classical paper of de Bruijn, Knuth and Rice, there is computed the average height of planted plane trees with n nodes assuming that all n-node trees are equally likely. The first section of this paper is devoted to the computation of the cumulative distribution function of this problem; we give an asymptotic equivalent in terms of familiar functions (Theorem 1). Then we derive an explicit expression and an asymptotic equivalent for the sth moment about origin of this distribution (Theorem 2). In the last section we compute the average stack size after t units of time during postorder-traversing of a binary tree with n leaves. Thereby, in one unit of time, a node is stored in the stack or is removed from the top of the stack.KeywordsBinary TreeAverage HeightSimple PolisArithmetical FunctionAsymptotic CaseThese keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.

Full Text
Published version (Free)

Talk to us

Join us for a 30 min session where you can share your feedback and ask us any queries you have

Schedule a call