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.
Similar content being viewed by others
References
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.
Huang, S-H.S., and Wong, C.K. Optimal binary split trees.J. Algorithms 5, 1 (1984), 65–79.
Huang, S-H.S., and Wong, C.K. Generalized binary split trees.Acta Inf. 21, 1 (1984), 113–123.
Knuth, D.E.The Art of Computer Programming, Vol. III: Sorting and Searching, Addison-Wesley, Reading, Mass., 1973.
Perl, Y. Optimum split trees.J. Algorithms 5, 3 (Sept. 1984), 367–374.
Sheil, B.A. Median split trees: a fast lookup technique for frequently occurring keys.Comm. ACM 21, 11 (Nov. 1978), 947–958.
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)
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).
Author information
Authors and Affiliations
Rights 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
Received:
Issue Date:
DOI: https://doi.org/10.1007/BF01178732