🎴 Flashcard Mode

Greedy Algorithms

Card1 / 15
Mastered0
Review0
QuestionClick to flip

Which of the following is a greedy algorithm?

AnswerClick to flip back
A
All of the above
💡 Explanation:

Dijkstra's algorithm, Prim's algorithm, and Kruskal's algorithm are all greedy algorithms. Dijkstra's algorithm finds the shortest path from a single source vertex to all other vertices in a weighted graph. Prim's algorithm finds a minimum spanning tree for a weighted graph. Kruskal's algorithm also finds a minimum spanning tree for a weighted graph.

Change Mode