Elsevier

Theoretical Computer Science

Volume 290, Issue 3, 3 January 2003, Pages 1799-1814
Theoretical Computer Science

Optimal binary search trees with costs depending on the access paths

https://doi.org/10.1016/S0304-3975(02)00084-1Get rights and content
Under an Elsevier user license
open archive

Abstract

We describe algorithms for constructing optimal binary search trees, in which the access cost of a key depends on the k preceding keys which were reached in the path to it. This problem has applications to searching on secondary memory and robotics. Two kinds of optimal trees are considered, namely optimal worst case trees and weighted average case trees. The time and space complexities of both algorithms are O(nk+2) and O(nk+1), respectively. The algorithms are based on a convenient decomposition and characterizations of sequences of keys which are paths of special kinds in binary search trees. Finally, using generating functions, we present an exact analysis of the number of steps performed by the algorithms.

Keywords

Algorithms
Optimal binary search trees
Generating functions

Cited by (0)

This paper has been partially supported by project CYTED VII.19 RIBIDI.

1

Partially supported by the Conselho Nacional de Desenvolvimento Cientı́fico e Tecnológico, CNPq, and Fundação de Amparo à Pesquisa do Estado do Rio de Janeiro, FAPERJ, Brazil.

2

Partially supported by Fondecyt Grant 99-0627.

3

Partially supported by SIAM project grant MCT/FINEP/CNPq/PRONEX 76.97.1016.00 and CNPq grant 520.916/94-8.