1.

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 complexityThis question was addressed to me by my school principal while I was bunking the class.Asked question is from Dynamic Programming in chapter Dynamic Programming of Data Structures & Algorithms II

Answer»

Right answer is (B) Decreases the time complexity and increases the SPACE complexity

The explanation is: 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

No Comment Found

Related InterviewSolutions