Upload Code
loading-left
loading loading loading
loading-right

Loading

Profile
No self-introduction
codes (1)
PRIM Algorithm
no vote
PRIM Algorithm Prim's algorithm selects the minimum weighted edge between a vertex we have not yet accepted, and a vertex that we have accepted. We use a bit array to track the vertex numbers we've accepted, and simply search weight-sorted edge list for the first entry where one vertex is accepted, and the other is not. This is an O(V 2 ), where V is the number of vertices. We could also contract the list after each accepted edge, but that doesn't change the overall time complexity.
caphesua
2016-08-23
0
1
No more~