In: Computer Science
Give pseudocode to implement a phase of Boruvka’s algorithm. Argue that ˙ the running time of your implementation is O(m)
Boruvka's Algorithm:
The second step of the algorithm is Boruvka's phase.
Pseudocode to implement a Boruvka's phase:
Assume the graph is given as adjacency list.
Time complexity of Boruvka's phase:
For each vertex we spend time to search the cheapest edge incident on it.
Therefore, total time taken by one phase of Boruvka's algorithm is the sum of degrees of the vertices, i.e.
.