How does dynamic programming make an inefficient recursive algorithm more effici
ID: 3562671 • Letter: H
Question
How does dynamic programming make an inefficient recursive algorithm more efficient?
A: By keeping track of previously computed recursive calls, and using the stored values when possible instead of initiating redundant recursive calls
B: By using arrays, which are inherently more efficient than recursion.
C: By dynamically changing the order in which multiple recursive calls are performed, thereby eliminating redundant recursive calls.
D:
By replacing the recursion with iteration, which is inherently more efficient.
By replacing the recursion with iteration, which is inherently more efficient.
Explanation / Answer
Answer: A: By keeping track of previously computed recursive calls, and using the stored values when possible instead of initiating redundant recursive calls
Explanation :
All dynamic Programming questions follow two basic properties
1) Overlapping Subproblems
2) Optimal Substructure
1) Overlapping Subproblems:
Like Divide and Conquer, Dynamic Programming combines solutions to sub-problems. Dynamic Programming is mainly used when solutions of same subproblems are needed again and again. In dynamic programming, computed solutions to subproblems are stored in a table so that these don
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.