Which one of the following algorithm design techniques is used in finding all pairs of shortest distances in a graph?
A
Greedy
No worries! We‘ve got your back. Try BYJU‘S free classes today!
B
Dynamic programming
Right on! Give the BNAT exam to get a 100% scholarship for BYJUS courses
C
Backtracking
No worries! We‘ve got your back. Try BYJU‘S free classes today!
D
Divide and Conquer
No worries! We‘ve got your back. Try BYJU‘S free classes today!
Open in App
Solution
The correct option is B Dynamic programming Bellman-Ford algorithm is used to find all pairs shortest distances in a graph and it is dynamic programming technique.