1. Computer Science Engineering (CSE)
  2. Design and Analysis of Algorithms
  3. When a top-down approach of dynamic prog...
Q.

When a top-down approach of dynamic programming is applied to a problem, it usually                            

A. decreases both, the time complexity and the space complexity
B. decreases the time complexity and increases the space complexity
C. increases the time complexity and decreases the space complexity
D. increases both, the time complexity and the space complexity
Answer» B. decreases the time complexity and increases the space complexity
Explanation: the top-down approach uses the memoization technique which stores the previously calculated values. due to this, the time complexity is decreased but the space complexity is increased.

Discussion