Question: Consider the following procedure whose input is an undirected graph G. Edges of G are represented by an adjacency LIST. weight(vi, vj) is a positive

 Consider the following procedure whose input is an undirected graph G.

Consider the following procedure whose input is an undirected graph G. Edges of G are represented by an adjacency LIST. weight(vi, vj) is a positive weight assigned to edge (vi, vj) procedure Proc2(G) 1 Q.Init; 2 foreach vertex vi E V(G) do Q is a min priority queue implemented as a heap */ foreach edge (vi, vj) incident on v; do w ? weight(vi,y); Q.Insert(w); 4 5 6end end s while (Q.IsNotEmpty) do 10Print w; 11 end Let n be the number of vertices of G and let m be the number of edges of G (a) Analyze lines 1-7 of Proc2 giving a bound on their asymptotic running time in terms of n and m (b) Analyze lines 8-11 of Proc2 giving a bound on their asymptotic running time in terms of n and m c) Give the asymptotic running time of Proc2 in terms of n and m Consider the following procedure whose input is an undirected graph G. Edges of G are represented by an adjacency LIST. weight(vi, vj) is a positive weight assigned to edge (vi, vj) procedure Proc2(G) 1 Q.Init; 2 foreach vertex vi E V(G) do Q is a min priority queue implemented as a heap */ foreach edge (vi, vj) incident on v; do w ? weight(vi,y); Q.Insert(w); 4 5 6end end s while (Q.IsNotEmpty) do 10Print w; 11 end Let n be the number of vertices of G and let m be the number of edges of G (a) Analyze lines 1-7 of Proc2 giving a bound on their asymptotic running time in terms of n and m (b) Analyze lines 8-11 of Proc2 giving a bound on their asymptotic running time in terms of n and m c) Give the asymptotic running time of Proc2 in terms of n and m

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!