Reducing Splaying by Taking Advantage of Working Sets

  • Timo Aho
  • Tapio Elomaa
  • Jussi Kujala
Part of the Lecture Notes in Computer Science book series (LNCS, volume 5038)


Access requests to keys stored into a data structure often exhibit locality of reference in practice. Such a regularity can be modeled, e.g., by working sets. In this paper we study to what extent can the existence of working sets be taken advantage of in splay trees. In order to reduce the number of costly splay operations we monitor for information on the current working set and its change. We introduce a simple algorithm which attempts to splay only when necessary. Under worst-case analysis the algorithm guarantees an amortized logarithmic bound. In empirical experiments it is 5% more efficient than randomized splay trees and at most 10% more efficient than the original splay tree. We also briefly analyze the usefulness of the commonly-used Zipf’s distribution as a general model of locality of reference.


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.


  1. 1.
    Cormen, T.H., Leiserson, C.E., Rivest, R.L., Stein, C.: Introduction to Algorithms, 2nd edn. The MIT Press, Cambridge, MA (2001)MATHGoogle Scholar
  2. 2.
    Sleator, D.D., Tarjan, R.E.: Self-adjusting binary search trees. Journal of the ACM 32(3), 652–686 (1985)CrossRefMathSciNetMATHGoogle Scholar
  3. 3.
    Fürer, M.: Randomized splay trees. In: Proceedings of the Tenth Annual ACM-SIAM Symposium on Discrete Algorithms, Baltimore, MD, pp. 903–904. SIAM, Philadelphia, PA (1999)Google Scholar
  4. 4.
    Albers, S., Karpinski, M.: Randomized splay trees: Theoretical and experimental results. Information Processing Letters 81(4), 213–221 (2002)CrossRefMathSciNetMATHGoogle Scholar
  5. 5.
    Lai, T.W., Wood, D.: Adaptive heuristics for binary search trees and constant linkage cost. In: Proceedings of the Second Annual ACM-SIAM Symposium on Discrete Algorithms, San Francisco, CA, pp. 72–77. SIAM, Philadelphia (1991)Google Scholar
  6. 6.
    Williams, H.E., Zobel, J., Heinz, S.: Self-adjusting trees in practice for large text collections. Software: Practice and Experience 31(10), 925–939 (2001)CrossRefMATHGoogle Scholar
  7. 7.
    Bell, J., Gupta, G.: An evaluation of self-adjusting binary search tree techniques. Software: Practice and Experience 23(4), 369–382 (1993)CrossRefGoogle Scholar
  8. 8.
    Heinz, S., Zobel, J.: Performance of data structures for small sets of strings. Australian Computer Science Communications 24(1), 87–94 (2002)Google Scholar
  9. 9.
    Pfaff, B.: Performance analysis of BSTs in system software. ACM SIGMETRICS Performance Evaluation Review 32(1), 410–411 (2004)CrossRefGoogle Scholar
  10. 10.
    Lee, E.K., Martel, C.U.: When to use splay trees. Software: Practice and Experience 37(15), 1559–1575 (2007)CrossRefGoogle Scholar
  11. 11.
    Denning, P.J.: Working sets past and present. IEEE Transactions on Software Engineering 6(1), 64–84 (1980)CrossRefGoogle Scholar
  12. 12.
    Subramanian, A.: An explanation of splaying. Journal of Algorithms 20(3), 512–525 (1996)CrossRefMathSciNetMATHGoogle Scholar
  13. 13.
    Badr, G.H., Oommen, B.J.: Self-adjusting of ternary search tries using conditional rotations and randomized heuristics. The Computer Journal 48(2), 200–219 (2005)CrossRefGoogle Scholar
  14. 14.
    Iacono, J.: Alternatives to splay trees with O(logn) worst-case access times. In: Proceedings of the Twelfth Annual ACM-SIAM Symposium on Discrete Algorithms, Washington, DC, pp. 516–522. SIAM, Philadelphia (2001)Google Scholar
  15. 15.
    Sleator, D.D., Tarjan, R.E.: Amortized efficiency of list update and paging rules. Communications of the ACM 28(2), 202–208 (1985)CrossRefMathSciNetGoogle Scholar
  16. 16.
    Amer, A., Oommen, B.J.: Lists on lists: A framework for self-organizing lists in environments with locality of reference. In: Àlvarez, C., Serna, M.J. (eds.) WEA 2006. LNCS, vol. 4007, pp. 109–120. Springer, Heidelberg (2006)CrossRefGoogle Scholar
  17. 17.
    Dhodapkar, A.S., Smith, J.E.: Managing multi-configuration hardware via dynamic working set analysis. In: Proceedings of the 29th Annual International Symposium on Computer Architecture, Anchorage, AK, pp. 233–244. IEEE Computer Society, Los Alamitos (2002)CrossRefGoogle Scholar
  18. 18.
    Seidel, R., Aragon, C.: Randomized search trees. Algorithmica 16(4), 464–497 (1996)CrossRefMathSciNetMATHGoogle Scholar
  19. 19.
    Cheetham, R.P., Oommen, B.J., Ng, D.T.: Adaptive structuring of binary search trees using conditional rotations. IEEE Transactions on Knowledge and Data Engineering 5(4), 695–704 (1993)CrossRefGoogle Scholar
  20. 20.
    Martínez, C., Roura, S.: Randomized binary search trees. Journal of the ACM 45(2), 288–323 (1998)CrossRefMathSciNetMATHGoogle Scholar
  21. 21.
    Knuth, D.E.: The Art of Computer Programming. Sorting and Searching, 2nd edn., vol. 3. Addison-Wesley, Boston (1998)Google Scholar
  22. 22.
    Brodal, G.S., Fagerberg, R., Jacob, R.: Cache oblivious search trees via binary trees of small height. In: Proceedings of the Thirteenth Annual ACM-SIAM Symposium on Discrete Algorithms, San Francisco, CA, pp. 39–48. SIAM, Philadelphia, PA (2002)Google Scholar
  23. 23.
    Applebaum, D.: Lévy processes — from probability to finance and quantum groups. Notices of the American Mathematical Society 51(11), 1336–1347 (2004)MathSciNetMATHGoogle Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 2008

Authors and Affiliations

  • Timo Aho
    • 1
  • Tapio Elomaa
    • 1
  • Jussi Kujala
    • 1
  1. 1.Department of Software SystemsTampere University of TechnologyTampereFinland

Personalised recommendations