Design a dynamic programming algorithm for the problem.
• Define the original problem as a function that takes parameters,and return some results.
• Define the subproblems
• Write recursive formula that relates a problem’s solution tosolutions of smaller subproblems.
• Finally write out pseudocode for the algorithm (using top-downmemoization or bottom-up)
Suppose a list P[1.. ] gives the daily stock price of a certain company for a duration of n days,
OR
OR