Data Structures & AlgorithmsHardICPC regional · geometry MST

Problem: Which algorithm solves the 'minimum cost to connect all points' in the Euclidean plane with n points in O(n^2) time (dense graph)?

  1. A. Bellman-Ford
  2. B. Kosaraju's algorithm
  3. C. Hungarian algorithm
  4. D. Prim's algorithm on the complete graph

Correct answer: D. Prim's algorithm on the complete graph

Prim's O(V^2) variant is ideal for dense complete graphs such as the one on n points.

More Coding Interview Problems questions

Exams that ask this topic