Abstract
We consider the problem of maintaining a binary search tree that minimizes the average access cost with respect to randomly generated requests. We analyze scenarios, in which the accesses are generated according to a vector of probabilities, which is fixed but unknown.
In this paper we devise policies for modifying the tree structure dynamically, using rotations of accessed elements towards the root. Our aim is to produce good approximations of the optimal order of the tree, while minimizing the amount of rotations.
We first introduce the Move Once (mo) rule, under which the average access cost to the tree is shown to equal the average access cost under the commonly used Move to the Root (mtr), at each reference. The advantage of mo over other rules is that mo relocates each of the items in the tree at most once. Consequently, modifying the tree by the mo rule results in O(nlgn) rotations (with n the number of items) for any infinite sequence of accesses.
Then we propose to combine the mo with the usage of counters (accumulating the reference history for each item), that provide approximations of the reference probabilities. We show, that for any δ, α>0, this rule (which we call moucs) approaches the optimal cost to within a difference of δ with probability higher than 1−α, after a number of accesses, which is linear in n times 1/α times 1/δ 2.
Keywords
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.
Author supported in part by the Technion V.P.R. Fund — E. and J. Bishop Research Fund and by the Fund for the Promotion of Research at the Technion.
Preview
Unable to display preview. Download preview PDF.
References
B. Allen, I. Munro, “Self-Organizing Search Trees”, JACM 25, #4, 526–535 (1978).
M.J. Atallah, S.R. Kosaraju, L.L. Larmore, G.L. Miller, S-H Teng, “Constructing Trees in Parallel”, In Proc. of the 2nd IEEE Symposium on Parallel Algorithms and Architectures, (1989).
P.J. Bayer, “Improved Bounds on the Costs of Optimal and Balanced Search Trees”, Tech. Memo. 69, Proj. MAC M.I.T. Cambridge MA 1975.
J. Bitner, “Heuristics that Dynamically Organize Data Structures”, SIAM J. Comput, 8,1, pp. 82–110, 1979.
A. Boneh, M.Hofri, “The Coupon-Collector Problem Revisited.” Purdue University, Department of Computer Science, CSD-TR-952, February 1990.
W. Feller, An Introduction to Probability Theory and its Applications John Willey, New York, 1968.
M. L. Fredman, “Two Applications of a Probabilistic Search Technique: Sorting X+Y and Building Balanced Search Trees”, 7th ACM Symp. on Theory of Computing, Albuquerque 1975.
I. Galperin, R. Rivest, “Scapegoat Trees”, In Proc. of the 4th ACM-SIAM Symposium on Discrete Algorithms, Austin, TX, January 25–27, 1993.
R. Guttler, K. Mehlhorn, W. Schneider, “Binary Search Trees: Average and Worst Case Behavior”, Jour. of Information Processing and Cybernetics, 16, 41–61, (1980).
M. Hofri, H. Shachnai, “Self-Organizing Lists and Independent References — a Statistical Synergy”, Jour. of Alg., 12, 533–555, (1991).
M. Hofri, H. Shachnai, “On the Optimality of Counter Scheme for Dynamic Linear Lists”, Inf. Process. Lett., 37, 175–179, (1991).
T.C. Hu, K. C. Tan, “Least Upper Bound on the Cost of Optimum Binary Search Trees”, Acta Information, 1, 307–310, (1972).
D.G. Kirkpatrick, T.M. Przytycka, “Parallel Construction of Binary Trees with Almost Optimal Weighted Path Length”, In Proc. of the 2nd IEEE Symposium on Parallel Algorithms and Architectures, (1990).
D.E. Knuth, “Optimum Binary Search Trees”, Acta Informatica 1, 11–25,1971.
D.E. Knuth, The Art of Computer Programming, Vol 3: Sorting and Searching Addison-Wesley, Reading MA 1973.
T. W. Lai, D. Wood, “Adaptive Heuristics for Binary Search Trees and Constant Linkage Cost”, In Proc. of the end ACM-SIAM Symposium on Discrete Algorithms, pp. 72–77, San Francisco, CA, January 28–30, 1991.
K. Mehlhorn, “Nearly Optimal Binary Search Trees”, Acta Informatica 5 287–295, (1975).
K. Mehlhorn, A. Tsakalidis, “Data. Structures”. In J. van Leeuwen, editor, Algorithms and Complexity, Vol A, chapter 6, pp. 301–341, Elsevier, 1990.
D.D. Sleator, R.E. Tarjan, “Self-Adjusting Binary search Trees”, JACM 32, #3, 652–686 (1985).
D.D. Sleator, R.E. Tarjan, “Amortized Efficiency of List Update and Paging Rules”, Commun. ACM 28,2, pp. 202–208, (1985).
Author information
Authors and Affiliations
Editor information
Rights and permissions
Copyright information
© 1994 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Hofri, M., Shachnai, H. (1994). Efficient reorganization of binary search trees. In: Bonuccelli, M., Crescenzi, P., Petreschi, R. (eds) Algorithms and Complexity. CIAC 1994. Lecture Notes in Computer Science, vol 778. Springer, Berlin, Heidelberg. https://doi.org/10.1007/3-540-57811-0_13
Download citation
DOI: https://doi.org/10.1007/3-540-57811-0_13
Published:
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-57811-6
Online ISBN: 978-3-540-48337-3
eBook Packages: Springer Book Archive