Skip to main content
Top

2015 | OriginalPaper | Chapter

Optimal Search Trees with 2-Way Comparisons

Authors : Marek Chrobak, Mordecai Golin, J. Ian Munro, Neal E. Young

Published in: Algorithms and Computation

Publisher: Springer Berlin Heidelberg

Activate our intelligent search to find suitable subject content or patents.

search-config
loading …

Abstract

In 1971, Knuth gave an \(O(n^2)\)-time algorithm for the classic problem of finding an optimal binary search tree. Knuth’s algorithm works only for search trees based on 3-way comparisons, but most modern computers support only 2-way comparisons (\(<\), \(\le \), \(=\), \(\ge \), and \(>\)). Until this paper, the problem of finding an optimal search tree using 2-way comparisons remained open — poly-time algorithms were known only for restricted variants. We solve the general case, giving (i) an \(O(n^4)\)-time algorithm and (ii) an \(O(n\log n)\)-time additive-3 approximation algorithm. For finding optimal binary split trees, we (iii) obtain a linear speedup and (iv) prove some previous work incorrect.

Dont have a licence yet? Then find out more about our products and how to get one now:

Springer Professional "Wirtschaft+Technik"

Online-Abonnement

Mit Springer Professional "Wirtschaft+Technik" erhalten Sie Zugriff auf:

  • über 102.000 Bücher
  • über 537 Zeitschriften

aus folgenden Fachgebieten:

  • Automobil + Motoren
  • Bauwesen + Immobilien
  • Business IT + Informatik
  • Elektrotechnik + Elektronik
  • Energie + Nachhaltigkeit
  • Finance + Banking
  • Management + Führung
  • Marketing + Vertrieb
  • Maschinenbau + Werkstoffe
  • Versicherung + Risiko

Jetzt Wissensvorsprung sichern!

Springer Professional "Technik"

Online-Abonnement

Mit Springer Professional "Technik" erhalten Sie Zugriff auf:

  • über 67.000 Bücher
  • über 390 Zeitschriften

aus folgenden Fachgebieten:

  • Automobil + Motoren
  • Bauwesen + Immobilien
  • Business IT + Informatik
  • Elektrotechnik + Elektronik
  • Energie + Nachhaltigkeit
  • Maschinenbau + Werkstoffe




 

Jetzt Wissensvorsprung sichern!

Springer Professional "Wirtschaft"

Online-Abonnement

Mit Springer Professional "Wirtschaft" erhalten Sie Zugriff auf:

  • über 67.000 Bücher
  • über 340 Zeitschriften

aus folgenden Fachgebieten:

  • Bauwesen + Immobilien
  • Business IT + Informatik
  • Finance + Banking
  • Management + Führung
  • Marketing + Vertrieb
  • Versicherung + Risiko




Jetzt Wissensvorsprung sichern!

Appendix
Available only for authorised users
Footnotes
1
As defined here, a 2wcst T must determine the relation of the query \(v\) to every key in \(\mathcal{K}\). More generally, one could specify any partition \(\mathcal P\) of \(\mathcal{Q}\), and only require T to determine, if at all possible using keys in \(\mathcal{K}\), which set \(S\in \mathcal P\) contains \(v\). For example, if \(\mathcal P = \{\mathcal{K}, \mathcal{Q}\setminus \mathcal{K}\}\), then T would only need to determine whether \(v\in \mathcal{K}\). We note without proof that Theorem 1 extends to this more general formulation.
 
2
For an algorithm that works with linear (or O(1)-degree polynomial) functions of \(\beta \).
 
3
If it is possible to distinguish \(v=K_i\) from \(K_i < v < K_{i+1}\), then \(\mathcal{C}\) must have at least one operator other than \(<\), so we can add either \({ \left\langle v= K_i \right\rangle }\) or \({ \left\langle v\le K_i \right\rangle }\).
 
Literature
1.
go back to reference Anderson, R., Kannan, S., Karloff, H., Ladner, R.E.: Thresholds and optimal binary comparison search trees. J. Algorithms 44, 338–358 (2002)MathSciNetCrossRefMATH Anderson, R., Kannan, S., Karloff, H., Ladner, R.E.: Thresholds and optimal binary comparison search trees. J. Algorithms 44, 338–358 (2002)MathSciNetCrossRefMATH
3.
go back to reference Comer, D.: A note on median split trees. ACM Trans. Program. Lang. Syst. 2(1), 129–133 (1980)CrossRef Comer, D.: A note on median split trees. ACM Trans. Program. Lang. Syst. 2(1), 129–133 (1980)CrossRef
6.
go back to reference Hester, J.H., Hirschberg, D.S., Huang, S.H., Wong, C.K.: Faster construction of optimal binary split trees. J. Algorithms 7(3), 412–424 (1986)MathSciNetCrossRefMATH Hester, J.H., Hirschberg, D.S., Huang, S.H., Wong, C.K.: Faster construction of optimal binary split trees. J. Algorithms 7(3), 412–424 (1986)MathSciNetCrossRefMATH
7.
go back to reference Hu, T.C., Tucker, A.C.: Optimal computer search trees and variable-length alphabetical codes. SIAM J. Appl. Math. 21(4), 514–532 (1971)MathSciNetCrossRefMATH Hu, T.C., Tucker, A.C.: Optimal computer search trees and variable-length alphabetical codes. SIAM J. Appl. Math. 21(4), 514–532 (1971)MathSciNetCrossRefMATH
11.
go back to reference Knuth, D.E.: The Art of Computer Programming. Sorting and Searching, vol. 3, 2nd edn. Addison-Wesley Publishing Company, Reading (1998)MATH Knuth, D.E.: The Art of Computer Programming. Sorting and Searching, vol. 3, 2nd edn. Addison-Wesley Publishing Company, Reading (1998)MATH
13.
go back to reference Sheil, B.A.: Median split trees: a fast lookup technique for frequently occuring keys. Commun. ACM 21(11), 947–958 (1978)CrossRefMATH Sheil, B.A.: Median split trees: a fast lookup technique for frequently occuring keys. Commun. ACM 21(11), 947–958 (1978)CrossRefMATH
14.
go back to reference Spuler, D.: Optimal search trees using two-way key comparisons. Acta Inform. 740, 729–740 (1994)CrossRefMATH Spuler, D.: Optimal search trees using two-way key comparisons. Acta Inform. 740, 729–740 (1994)CrossRefMATH
15.
go back to reference Spuler, D.A.: Optimal search trees using two-way key comparisons. Ph.D. thesis, James Cook University (1994) Spuler, D.A.: Optimal search trees using two-way key comparisons. Ph.D. thesis, James Cook University (1994)
Metadata
Title
Optimal Search Trees with 2-Way Comparisons
Authors
Marek Chrobak
Mordecai Golin
J. Ian Munro
Neal E. Young
Copyright Year
2015
Publisher
Springer Berlin Heidelberg
DOI
https://doi.org/10.1007/978-3-662-48971-0_7

Premium Partner