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.
2.9k
0
Do you find this helpful?
20

Discussion

No comments yet