Skip to main content
Log in

Optimal search trees using two-way key comparisons

  • Published:
Acta Informatica Aims and scope Submit manuscript

Abstract

A generalization of binary search trees and binary split trees is developed that takes advantage of two-way key comparisons: the two-way comparison tree. The two-way comparison tree has little use for dynamic situations but is an improvement over the optimal binary search tree and the optimal binary split tree for static data sets. AnO(n) time and space algorithm is presented for constructing an optimal two-way comparison tree when access probabilities are equal, and an exact formula for the optimal cost is developed. The construction of the optimal two-way comparison tree for unequal access frequencies, both successful and unsuccessful, is computable inO(n 5) time andO(n 3) space using algorithms similar to those for the optimal binary split tree. The optimal two-way comparison tree can improve search cost by up to 50% over the optimal binary search tree.

This is a preview of subscription content, log in via an institution to check access.

Access this article

Price excludes VAT (USA)
Tax calculation will be finalised during checkout.

Instant access to the full article PDF.

Similar content being viewed by others

References

  1. Hester, J.H., Hirschberg, D.S., Huang, S-H.S., and Wong, C.K. Faster construction of optimal binary split trees.J. Algorithms 7, 3 (1986), 412–424.

    Google Scholar 

  2. Huang, S-H.S., and Wong, C.K. Optimal binary split trees.J. Algorithms 5, 1 (1984), 65–79.

    Google Scholar 

  3. Huang, S-H.S., and Wong, C.K. Generalized binary split trees.Acta Inf. 21, 1 (1984), 113–123.

    Google Scholar 

  4. Knuth, D.E.The Art of Computer Programming, Vol. III: Sorting and Searching, Addison-Wesley, Reading, Mass., 1973.

    Google Scholar 

  5. Perl, Y. Optimum split trees.J. Algorithms 5, 3 (Sept. 1984), 367–374.

    Google Scholar 

  6. Sheil, B.A. Median split trees: a fast lookup technique for frequently occurring keys.Comm. ACM 21, 11 (Nov. 1978), 947–958.

    Google Scholar 

  7. Spuler, D.A. Two-way comparison search trees: a generalization of binary search trees and split trees, Technical Report 92/5, Dept. Computer Science, James Cook University, Townsville, 4811, Australia, July 1992. (FTPcoral.cs.jcu.edu.au in thepub/techreports directory)

    Google Scholar 

  8. Spuler, D.A. Optimal Binary Trees With Two-Way Key Comparisons PhD Thesis, Dept. Computer Science, James Cook University, Townsville, 4811, Australia, 1994 (to appear).

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Rights and permissions

Reprints and permissions

About this article

Cite this article

Spuler, D. Optimal search trees using two-way key comparisons. Acta Informatica 31, 729–740 (1994). https://doi.org/10.1007/BF01178732

Download citation

  • Received:

  • Issue Date:

  • DOI: https://doi.org/10.1007/BF01178732

Keywords

Navigation