Q. In dynamic programming, what is the purpose of the 'table' or 'array' used?
A.
To store intermediate results.
B.
To sort the input data.
C.
To keep track of function calls.
D.
To manage memory allocation.
Solution
The table or array in dynamic programming is used to store intermediate results of subproblems, which helps in building up the solution to the overall problem.
Correct Answer:
A
— To store intermediate results.
Q. Which dynamic programming problem involves finding the minimum number of coins needed to make a certain amount?
A.
Longest Increasing Subsequence
B.
Coin Change Problem
C.
Edit Distance
D.
Fibonacci Sequence
Solution
The Coin Change Problem is a classic dynamic programming problem that involves finding the minimum number of coins needed to make a certain amount of money.
Q. Which of the following is NOT a typical dynamic programming problem?
A.
Longest Common Subsequence
B.
Matrix Chain Multiplication
C.
Depth First Search
D.
Coin Change Problem
Solution
Depth First Search (DFS) is a graph traversal algorithm and is not a dynamic programming problem, while the others are classic examples of problems that can be solved using dynamic programming.