Depth of a Random Binary Search Tree with Concurrent Insertions
Shuffle a deck of n cards numbered 1 through n. Deal out the first c cards into a hand. A player then repeatedly chooses one of the cards from the hand, inserts it into a binary search tree, and then adds the next card from deck to the hand (if the deck is empty). When the player finally runs out of cards, how deep can the search tree be?
This problem is motivated by concurrent insertions by c processes of random keys into a binary search tree, where the order of insertions is controlled by an adversary that can delay individual processes. We show that an adversary that uses any strategy based on comparing keys cannot obtain an expected average depth greater than \(O(c + \log n)\). However, the adversary can obtain an expected tree height of \(\varOmega (c \log (n/c))\), using a simple strategy of always playing the largest available card.
Funding for the second author was provided by the Natural Sciences and Engineering Research Council of Canada.
- 2.Bronson, N.G., Casper, J., Chafi, H., Olukotun, K.: A practical concurrent binary search tree. In: Proceedings of the 15th ACM Symposium on Principles and Practice of Parallel Programming, pp. 257–268 (2010)Google Scholar
- 3.Brown, T., Ellen, F., Ruppert, E.: A general technique for non-blocking trees. In: Proceedings of the 19th ACM Symposium on Principles and Practice of Parallel Programming, pp. 329–342 (2014)Google Scholar
- 7.Ellen, F., Fatourou, P., Ruppert, E., van Breugel, F.: Non-blocking binary search trees. In: Proceedings of the 29th ACM Symposium on Principles of Distributed Computing, pp. 131–140 (2010)Google Scholar
- 8.Guibas, L.J., Sedgewick, R.: A dichromatic framework for balanced trees. In: Proceedings of the 19th IEEE Symposium on Foundations of Computer Science, pp. 8–21 (1978)Google Scholar
- 9.Mahmoud, H.M.: Evolution of Random Search Trees. Wiley, New York (1992)Google Scholar
- 11.Mitzenmacher, M., Upfal, E.: Probability and Computing: Randomized Algorithms and Probabilistic Analysis, Chap. 12. Cambridge University Press, Cambridge (2005)Google Scholar
- 14.Williams, D.: Probability with Martingales. Cambridge University Press, Cambridge (1991)Google Scholar