Abstract
An algorithm for inserting an element into a one-sided height-balanced (OSHB) binary search tree is presented. The algorithm operates in time O(log n), where n is the number of nodes in the tree. This represents an improvement over the best previously known insertion algorithms of Hirschberg and Kosaraju, which require time O(log2n). Moreover, the O(log n) complexity is optimal.
Earlier results have shown that deletion in such a structure can also be performed in O(log n) time. Thus the result of this paper gives a negative answer to the question of whether such trees should be the first examples of their kind, where deletion has a smaller time complexity than insertion. Furthermore, it can now be concluded that insertion, deletion, and retrieval in OSHB trees can be performed in the same time as the corresponding operations for the more general AVL trees, to within a constant factor. However, the insertion and deletion algorithms for OSHB trees appear much more complicated than the corresponding algorithms for AVL trees.
- 1 Adel'son-Vel'skii, G.M., and Landis, E.M. An algorithm for the organization of information. Doklady Akademia Nauk SSSR 146 (1962), 263-266; English translation in Soviet Math. 3 (1962), 1259- 1263.Google Scholar
- 2 Hirschberg, D.S, An insertion technique for one-sided heightbalanced trees. Comm. A CM 19, 8 (Aug. 1976), 471-473. Google ScholarDigital Library
- 3 Karlton, P.L., Fuller, S.H., Scroggs, R.E., and Kaehler, E. B. Performance of height-balanced trees. Comm. A CM 19, 1 (Jan. 1976), 23-28. Google ScholarDigital Library
- 4 Knuth, D.E. The Art of Computer Programming, Vol. 3: Sorting and Searching. Addison-Wesley, Reading, Mass., 1973. Google ScholarDigital Library
- 5 Kosaraju, S.R. Insertions and deletions in one-sided heightbalanced trees. Comm. A CM 21, 3 (Mar. 1978), 226-227. Google ScholarDigital Library
- 6 Maurer, H.A., and Ottmann, Th. Tree-structures for set manipulation problems. In Mathematical Foundations of Computer Science 1977, J. Gruska; Ed., Springer-Verlag, Berlin-Heidelberg- New York, 1977, pp. 108-121.Google Scholar
- 7 Ottmann, Th. On log(n) solutions of the dictionary problem for one-sided height-balanced binary search trees. Bull, European Assoc. Theoret. Comptr. Sci. 4 (Jan. 1978), 20-25.Google Scholar
- 8 Ottmann, Th., and Six, H.-W. Eine neue Klasse von ausgeglichenen Bin~irb~iumen. Angewandte Informatik 18, 9 (Sept. 1976), 395-400.Google Scholar
- 9 Ottmann, Th., Six, H.-W., and Wood, D. Right brother trees. Comm. ACM 21, 9 (Sept. 1978), 769-776. Google ScholarDigital Library
- 10 Ottmann, Th., Six, H.-W., and Wood, D. On the correspondence between AVL-trees and brother trees. Rep. 61, lnstitut fiir Angewandte Informatik und Formale Beschreibungsverfahren, U. Karlsruhe, Karlsruhe, Germany, 1977.Google Scholar
- 11 Ottmann, Th., and Wood, D. Deletion in one-sided heightbalanced search trees. Int. J. Comp. Math. 6, 4 (1978), 265-271.Google ScholarCross Ref
- 12 Van Leeuwen, J. The complexity of data organization. In Foundations of Computer Science, Part I, K.R. Apt and J.W. de Bakker, Eds., Mathematical Centre Tracts 81, Amsterdam, 1976, pp. 37-147.Google Scholar
- 13 Zweben, S.H., and McDonald, M.A. An optimal method for deletion in one-sided height-balanced trees. Comm. A CM 21, 6 (June 1978), 441--445. Google ScholarDigital Library
Index Terms
- An optimal insertion algorithm for one-sided height-balanced binary search trees
Recommendations
Rank-Balanced Trees
Since the invention of AVL trees in 1962, many kinds of binary search trees have been proposed. Notable are red-black trees, in which bottom-up rebalancing after an insertion or deletion takes O(1) amortized time and O(1) rotations worst-case. But the ...
Right brother trees
Insertion and deletion algorithms are provided for the class of right (or one-sided) brother trees which have O (log n) performance. The importance of these results stems from the close relationship of right brother trees to one-sided height-balanced ...
On the Height of Multidimensional Height-Balanced Trees
It is shown that the worst case height of a k- dimensional height-balanced tree, k = 2, is the same as that of an AVL-tree, to within an additive factor of 2k - 2.
Comments