Yahoo Answers: Answers and Comments for 資料結構與演算法相關問題 [程式設計]
Copyright © Yahoo! Inc. All rights reserved.
https://answers.yahoo.com/question/index?qid=20090410000016KK00035
From 妞妞
enUS
Fri, 10 Apr 2009 00:03:38 +0000
3
Yahoo Answers: Answers and Comments for 資料結構與演算法相關問題 [程式設計]
292
38
https://answers.yahoo.com/question/index?qid=20090410000016KK00035
https://s.yimg.com/zz/combo?images/emaillogous.png

From bean_bottom_2: Dynamic programming is used for problems that ...
https://answers.yahoo.com/question/index?qid=20090410000016KK00035
https://answers.yahoo.com/question/index?qid=20090410000016KK00035
Fri, 10 Apr 2009 08:04:02 +0000
Dynamic programming is used for problems that can be divided into small pieces, each one overlaps the other and each one of them will require the result from another one. Good example is Fibonacci numbers when F(n) needs F(n1) and F(n2).
So, if a problem can be divided into smaller pieces but each pieces are independent to each other. Thus, none of the results can be used by another. This will not be a good candidate for dynamic programming.
Example:
Given an integer X, find the largest prime P and P < X.
You can divide this up to smaller pieces (partitioning X) but none of the pieces will give you optimal structure and none of them will give any results that can be use to evolve to a best solution.