Question: 3. Let P be an implementation of a min priority queue where: P. Init() takes ? (1) time. Initially, P has 0 elements . P.Insert(x)

3. Let P be an implementation of a min priority queue where: P. Init() takes ? (1) time. Initially, P has 0 elements . P.Insert(x) takes ?(v/5) time where s is the number of elements in P Pins ert() adds one element to P P.DeleteMin() takes ?(s3/4) time where s is the number of elements in P P.DeleteMinremoves one element from P Consider the following procedure whose input is an undirected graph G. Edges of G are represented by an adjacency LIST. weight Vi Uj) ?s a positive weight assigned to edge (UnUj) Proc3(G) 1 P.Init(O; 2 for each vertex vi of G do 3 for each vertex v of G do P. Insert (weight (v) * weight(%)); 5 end 6 end s for each vertex vi of G do 9for each edge (vi, vj) incident on vi do 10 11end 12 end 13 return (x); Let n be the number of vertices of G and let m be the number of edges of G. Assume that m n (a) Analyze lines 1-6 of Proc3 giving a bound on their asymptotic running time in terms of n and m (b) Analyze lines 7-13 of Proc3 giving a bound on their asymptotic running time in terms of n and m (c) Give the asymptotic running time of Proc3 in terms of n and m
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
