Question
An implementation of Prims minimum spanning tree algorithm is shown below. It uses the adjacency list representation. This implementation keeps the best candidate edge going
An implementation of Prims minimum spanning tree algorithm is shown below. It uses the adjacency list representation. This implementation keeps the best candidate edge going into vertex and simply scans the list of vertices each time to find the next candidate vertex and its associated edges. I want you to carefully analyze the execution time of this code. For each line marked with an arrow, specify the worst case number of times the line could be executed during the complete execution of this algorithm on a graph with V vertices and E edges. Your answers should be exact mathematical formula in terms of V,E and numerical constants. For these answers do not use asymptotic notation.
Based on the above analysis, what is the big-O execution time ?
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started