Recall & Review
beginner Click to reveal answer
What is the main idea behind using Dynamic Programming (DP) to find Fibonacci numbers?
DP stores the results of smaller subproblems (like previous Fibonacci numbers) to avoid repeated calculations, making the process faster.
beginner Click to reveal answer
In Fibonacci DP, what does the 'memoization' technique mean?
Memoization means saving the results of Fibonacci calculations in a table or array so we can reuse them instead of recalculating.
intermediate Click to reveal answer
Why is the DP approach to Fibonacci more efficient than the simple recursive approach?
Because DP avoids repeated work by storing results, reducing the time from exponential to linear.
beginner Click to reveal answer
What is the time complexity of Fibonacci calculation using DP?
The time complexity is O(n), where n is the Fibonacci number index.
beginner Click to reveal answer
Show the base cases used in Fibonacci DP and explain why they are important.
Base cases: fib(0) = 0 and fib(1) = 1. They are important because they stop the recursion and start the building of the solution.
What does DP store to optimize Fibonacci calculation?
✗ Incorrect
DP stores previous Fibonacci values to avoid recalculating them.
What is the time complexity of Fibonacci using DP?
✗ Incorrect
DP reduces the time complexity to O(n) by storing intermediate results.
Which technique is used in DP to save results of subproblems?
✗ Incorrect
Memoization saves results to avoid repeated calculations.
What are the base cases for Fibonacci DP?
✗ Incorrect
Base cases fib(0)=0 and fib(1)=1 start the calculation.
Why is simple recursion inefficient for Fibonacci?
✗ Incorrect
Simple recursion repeats calculations, causing exponential time.
Explain how Dynamic Programming improves Fibonacci number calculation compared to simple recursion.
Think about how saving answers helps avoid doing the same work twice.
You got /4 concepts.
Describe the role of base cases in the Fibonacci DP approach and why they are necessary.
Base cases are like the starting point or foundation for the calculation.
You got /4 concepts.
