skip to main content
article
Free Access

An optimal insertion algorithm for one-sided height-balanced binary search trees

Published:01 September 1979Publication History
Skip Abstract Section

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.

References

  1. 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 ScholarGoogle Scholar
  2. 2 Hirschberg, D.S, An insertion technique for one-sided heightbalanced trees. Comm. A CM 19, 8 (Aug. 1976), 471-473. Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  4. 4 Knuth, D.E. The Art of Computer Programming, Vol. 3: Sorting and Searching. Addison-Wesley, Reading, Mass., 1973. Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. 5 Kosaraju, S.R. Insertions and deletions in one-sided heightbalanced trees. Comm. A CM 21, 3 (Mar. 1978), 226-227. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. 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 ScholarGoogle Scholar
  7. 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 ScholarGoogle Scholar
  8. 8 Ottmann, Th., and Six, H.-W. Eine neue Klasse von ausgeglichenen Bin~irb~iumen. Angewandte Informatik 18, 9 (Sept. 1976), 395-400.Google ScholarGoogle Scholar
  9. 9 Ottmann, Th., Six, H.-W., and Wood, D. Right brother trees. Comm. ACM 21, 9 (Sept. 1978), 769-776. Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. 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 ScholarGoogle Scholar
  11. 11 Ottmann, Th., and Wood, D. Deletion in one-sided heightbalanced search trees. Int. J. Comp. Math. 6, 4 (1978), 265-271.Google ScholarGoogle ScholarCross RefCross Ref
  12. 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 ScholarGoogle Scholar
  13. 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 ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. An optimal insertion algorithm for one-sided height-balanced binary search trees
        Index terms have been assigned to the content through auto-classification.

        Recommendations

        Comments

        Login options

        Check if you have access through your login credentials or your institution to get full access on this article.

        Sign in

        Full Access

        • Published in

          cover image Communications of the ACM
          Communications of the ACM  Volume 22, Issue 9
          Sept. 1979
          47 pages
          ISSN:0001-0782
          EISSN:1557-7317
          DOI:10.1145/359146
          Issue’s Table of Contents

          Copyright © 1979 ACM

          Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]

          Publisher

          Association for Computing Machinery

          New York, NY, United States

          Publication History

          • Published: 1 September 1979

          Permissions

          Request permissions about this article.

          Request Permissions

          Check for updates

          Qualifiers

          • article

        PDF Format

        View or Download as a PDF file.

        PDF

        eReader

        View online with eReader.

        eReader