Q. What is the primary purpose of dynamic programming?
-
A.
To solve problems in linear time
-
B.
To optimize recursive algorithms
-
C.
To sort data efficiently
-
D.
To traverse data structures
Solution
The primary purpose of dynamic programming is to optimize recursive algorithms by storing results of subproblems.
Correct Answer:
B
— To optimize recursive algorithms
Learn More →
Q. Which of the following algorithms uses dynamic programming to find the shortest path in a graph?
-
A.
Dijkstra's Algorithm
-
B.
Bellman-Ford Algorithm
-
C.
A* Search
-
D.
Depth First Search
Solution
The Bellman-Ford Algorithm uses dynamic programming to find the shortest path in a graph with negative weights.
Correct Answer:
B
— Bellman-Ford Algorithm
Learn More →
Showing 1 to 2 of 2 (1 Pages)