Q. What is the primary advantage of using dynamic programming over recursion?
-
A.
It is always faster
-
B.
It uses less memory
-
C.
It avoids redundant calculations
-
D.
It is easier to implement
Solution
Dynamic programming avoids redundant calculations by storing the results of subproblems, making it more efficient than plain recursion.
Correct Answer:
C
— It avoids redundant calculations
Learn More →
Q. What is the result of applying dynamic programming to the Coin Change problem?
-
A.
Finding the minimum number of coins
-
B.
Finding all possible combinations of coins
-
C.
Finding the maximum value of coins
-
D.
Finding the average value of coins
Solution
Dynamic programming can be used to find the minimum number of coins needed to make a certain amount in the Coin Change problem.
Correct Answer:
A
— Finding the minimum number of coins
Learn More →
Q. Which of the following algorithms is an example of dynamic programming?
-
A.
Merge Sort
-
B.
Dijkstra's Algorithm
-
C.
Floyd-Warshall Algorithm
-
D.
Binary Search
Solution
The Floyd-Warshall Algorithm is an example of dynamic programming, used to find shortest paths in a weighted graph.
Correct Answer:
C
— Floyd-Warshall Algorithm
Learn More →
Showing 1 to 3 of 3 (1 Pages)