Q21GATE 2011MCQ
The average depth of a binary search tree is
📖 Explanation
For a binary search tree created from a random permutation of n distinct keys, the expected total internal path length D(n) (sum of depths of all nodes) satisfies the recurrence D(n)=n−1+n1∑i=0n−1(D(i)+D(n−1−i)). Solving this recurrence relation asymptotically yields D(n)≈2nlnn. Since the average depth of a node is defined as the total internal path length divided by the number of nodes n, we obtain nD(n)≈2lnn. This demonstrates that the average depth is logarithmic with respect to n. Thus, the average depth is O(logn).