All mock tests are FREE till 31 December — register to save your progress

Which of the following algorithms use Greedy strategy?

A. Dijkstra's algorithm

B. Kruskal's algorithm

C. Huffman coding

D. Bellman-Ford algorithm

Pick an option to check yourself, or open the answer below.

Show answer & explanation

Correct answer: B. A, B and C Only

Explanation

Dijkstra, Kruskal and Huffman coding make the locally best choice at each step (greedy). Bellman–Ford relaxes all edges repeatedly — dynamic programming.

More Data Structures and Algorithms questions