# Smoothed Analysis of Binary Search Trees

## Abstract

Binary search trees are one of the most fundamental data structures. While the height of such a tree may be linear in the worst case, the average height with respect to the uniform distribution is only logarithmic. The exact value is one of the best studied problems in average-case complexity.

We investigate what happens in between by analysing the smoothed height of binary search trees: Randomly perturb a given (adversarial) sequence and then take the expected height of the binary search tree generated by the resulting sequence. As perturbation models, we consider partial permutations, partial alterations, and partial deletions.

On the one hand, we prove tight lower and upper bounds of roughly \({\it \Theta}(\sqrt{n})\) for the expected height of binary search trees under partial permutations and partial alterations. This means that worst-case instances are rare and disappear under slight perturbations. On the other hand, we examine how much a perturbation can increase the height of a binary search tree, i.e. how much worse well balanced instances can become.

## Keywords

Tight Bound Partial Deletion Binary Search Tree Perturbation Model Marked Element## Preview

Unable to display preview. Download preview PDF.

## References

- 1.Banderier, C., Beier, R., Mehlhorn, K.: Smoothed analysis of three combinatorial problems. In: Rovan, B., Vojtáš, P. (eds.) MFCS 2003. LNCS, vol. 2747, pp. 198–207. Springer, Heidelberg (2003)CrossRefGoogle Scholar
- 2.Drmota, M.: An analytic approach to the height of binary search trees II. Journal of the ACM 50(3), 333–374 (2003)CrossRefMathSciNetGoogle Scholar
- 3.Reed, B.: The height of a random binary search tree. Journal of the ACM 50(3), 306–332 (2003)CrossRefMathSciNetGoogle Scholar
- 4.Spielman, D.A.: The smoothed analysis of algorithms. In: Liśkiewicz, M., Reischuk, R. (eds.) FCT 2005. LNCS, vol. 3623, pp. 17–18. Springer, Heidelberg (2005)CrossRefGoogle Scholar
- 5.Spielman, D.A., Teng, S.-H.: Smoothed analysis of algorithms: Why the simplex algorithm usually takes polynomial time. Journal of the ACM 51(3), 385–463 (2004)zbMATHCrossRefMathSciNetGoogle Scholar