简体   繁体   中英

Dynamic Programming:optimal Binary search tree and Huffman

Is it possible to construct an optimal Binary search tree (OBST) via a greedy algorithm instead of with Dynamic Programming (DP) (for example Huffman's algorithm)? If so why is DP is preferred in the construction of a OBST?

There are no efficient greedy algorithms to always construct an optimal binary search tree. However there are likely to be heuristics such as greedy algorithms that construct nearly optimal trees, which may be preferable in practice.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM