AlgoMaster Logo

Min Cost to Connect All Points

points=[[0,0],[2,2],[3,10],[5,2],[7,0]]
0 / 24
Points & MST EdgesP0(0,0)P1(2,2)P2(3,10)P3(5,2)P4(7,0)Union-Find Parent Array:Cost: 0Legend:DefaultConsideringIn MSTRejected (Cycle)
algomaster.io
Step:Initialize 5 points, 10 possible edges (sorted by cost)