Question: use step count method to find the time complexity of the prim's algorithm? Prim's Algorithm 1. Initialize Stal] with the start vertex, s, and Rem[]
use step count method to find the time complexity of the prim's algorithm?

Prim's Algorithm 1. Initialize Stal] with the start vertex, s, and Rem[] with the remaining vertices, r in which (v-s=r) 2. for all r in Rem[] 3. Set pat[r] to s 4. if there is an edge (s,r) 5. Set dis[v] to w(s,r) else 6. Set dis[r] to o 7. while Rem[] is not empty 8. for all unvisited u in Rem[] , find the smallest dis[u] 9. Remove u from Rem[] and add it to Stal] 10. Insert the edge (u, pat[u]) into the spanning tree. 11. for all v adjacent to u in Rem[] 12. if weight(ur)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
