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
- Match List I with List II
- Match List I with List II
- Considering the binary tree shown (A has children B and C; C has children D and E; E has right child F; F has children G and H), what will…
- Match the LIST-I with LIST-II
- Which of the following algorithms are based on the Breadth First Search (BFS) ? A. Prim's algorithms B. Kruskal algorithms C. Dijkstra algo…
- Which of the following is the solution of the recurrence T(n) = T(2n/3) + 1?