Algorithms and Data Structures · Middle · Question 65 of 75

Which algorithm finds a minimum spanning tree by adding the cheapest edges that don't create a cycle?

Explanation

Kruskal sorts edges by weight and uses union-find to skip edges that would connect vertices already in the same component. Dijkstra computes shortest paths, which is a different problem.

Further reading

Problem with a question

Algorithms and Data Structures · Middle · question 65

Test yourself

Take the Algorithms and Data Structures · Middle quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz