Abstract

Given Nweighted keysN+1 missing-key weights and a branching factor t the application of dynamic programming yields algorithms for constructing optimal binary search trees (t = 2), optimal multi-way search trees (t>2), and optimal leaf search trees (or alphabetic code trees) with leaf weights only. The basic running time in all cases is O(N 3)(in terms of the number of keys), but it can be reduced to O(N 2) for binary search trees by a “monotonicity” principle which restricts the number of candidates for the root at each step in the construction. This principle can also be applied for multiway search trees when the missing-key weights are zero. However it does not extend to optimal multiway search trees in general, as we demonstrate; in particular, there is no monotonicity principle for alphabetic code trees, contrary to what is claimed in [5].

Full Text
Published version (Free)

Talk to us

Join us for a 30 min session where you can share your feedback and ask us any queries you have

Schedule a call