Abstract

We investigate binary search trees formed from sequences of nondistinct keys under two models. In the first model, an input sequence is composed from elements of a given finite multiset and all possible sequences are equally-likely. In the second model, an input sequence is composed from n elements of a (possibly infinite) set, where each key has a specified probability; the n keys are independently chosen from the given set. Under both models, we shall derive general closed-form expressions for the expected values of the characteristic parameters defined on the corresponding binary search trees. These parameters include the (left, right) depth of a given key, the level of a given external node and the left (right) side or the internal (external) path length of a search tree. Furthermore, we find some nonobvious relations between these expected values. In some respects, the second model tends to the first model for large n. All results are illustrated by concrete examples sometimes showing unexpected phenomena.

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