Dynamic Programming Quiz
Which of the following problems is NOT solved using dynamic programming? A. 0/1 knapsack problem B. Rod-cutting problem C. nth Fibonacci number D. Fractional knapsack problem
0/1 knapsack problem
When a top-down recursive approach of dynamic programming is applied to a problem, it usually
Decreases the time complexity and increase the space complexity
A greedy algorithm can be used to solve all the dynamic programming problems
False
If a problem can be solved by combining optimal solutions to non-overlapping problems, the strategy is called?
Greedy Algorithms
In dynamic programming, the technique of storing the previously calculated values is called
Memoization
Naive recursion Fibonacci runs in?
O(2^n) : Exponential
What is the running time of the procedure CUT-ROD. It is given that the procedure CUT-ROD takes as input an array p[1......n] of prices and an integer n, and it returns the maximum revenue possible for a rod of length n
O(2^n) : Exponential
While computing the nth Fibonacci number using recursion, How many distinct recursive calls are made?
O(2^n) : Exponential
What is the running time of bottom up dynamic programming approach to Fibonacci
O(n)
If a problem can be broken into subproblems which are reused several times, the problem possesses __________________ property
Overlapping Subproblems
Naive recursion Fibonacci recurrence relation
T(0) = T(1) = 1 T(n) = T(n-1) + T(n-2)