Google interview question

minimum spanning tree O(n^2) algorithm