Q. Which of the following algorithms uses dynamic programming to find the optimal solution?
-
A.
Dijkstra's algorithm
-
B.
Bellman-Ford algorithm
-
C.
Floyd-Warshall algorithm
-
D.
Merge sort
Solution
The Floyd-Warshall algorithm uses dynamic programming to find the shortest paths between all pairs of vertices in a weighted graph.
Correct Answer:
C
— Floyd-Warshall algorithm
Learn More →
Q. Which of the following is a common real-world application of dynamic programming?
-
A.
Image compression
-
B.
Network routing
-
C.
Stock market prediction
-
D.
Resource allocation
Solution
Dynamic programming is often used in resource allocation problems where optimal distribution of limited resources is required.
Correct Answer:
D
— Resource allocation
Learn More →
Showing 1 to 2 of 2 (1 Pages)