Reducing Splaying by Taking Advantage of Working Sets
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.
- 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
- 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
- 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
- 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
- 21.Knuth, D.E.: The Art of Computer Programming. Sorting and Searching, 2nd edn., vol. 3. Addison-Wesley, Boston (1998)Google Scholar
- 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