202、Algorithms designed using dynamic programming are similar to those developed using divide-and-conquer in that both solve a problem by breaking it down into several subproblems that can be solved recursively.The difference between the two is that in the dynamic programming approach, the results obtained from solving smaller subproblems are reused in the calculation of larger subproblems.Thus, dynamic programming is a bottom-up technique that usually begins by solving the smallest subproblems, saving these results, and then reusing them to solve larger and larger subproblems until the solution to the original problem is obtained.This is in contrast to the divide-and-conquer approach, which solves problems in a top-down fashion.In this case the original problem is solved by breaking it down into increasingly smaller subproblems, and no attempt is made to reuse previous results in the solution of any of the subproblems.It is important to realize that a dynamic programming approach is only justified if there is some degree of overlap in the subproblems.The underlying idea is to avoid calculating the same result twice.This is usually accomplished by constructing a table in memory, and filing it with known results as they are calculated.These results are they used to solve larger subproblems.Dynamic programming is often used to solve optimization problems.In an optimization problem, there are typically a large number of possible solutions, and each has a cost associated with it.The goal is to find a solution that has the smallest cost -- this is referred to as an optimal solution.(3)、In order to solve the problem, what will a dynamic programming approach do?
答案解析
相关题目
74、I guess there are still some things we both have to learn together.
73、I can handle it我可以处理它
72、Their lives hold many of the secrets to () great ideas and putting them into practice
71、It took the experts several months to decide on the()for the new airport
70、So it is clear then, that to () a genius is to push the limits, in your mind, and beyond
69、Even the most powerful computer () the world cant be a genius because it has no character.
68、inside address是
67、Don't give anyone online your real last (), phone number, or your home address
66、Most of the problems () on the major online services
65、She and I would never () openly exchanged such words of affection
