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].

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

Disclaimer: All third-party content on this website/platform is and will remain the property of their respective owners and is provided on "as is" basis without any warranties, express or implied. Use of third-party content does not indicate any affiliation, sponsorship with or endorsement by them. Any references to third-party content is to identify the corresponding services and shall be considered fair use under The CopyrightLaw.