Q131
Given pseudo code of Dijkstra's Algorithm. //Initialise single source(G,s) S=0 Q=V[G] While Q != 0 Do u=extract-min(Q) S=S union u For each vertex v in adj[u] Do relax(u,v,w) What happens when "While Q != 0" is changed to "while Q>1"?
A.
While loop gets executed for v times
B.
While loop gets executed for v-1 times
AnswerC.
While loop gets executed only once
D.
While loop does not get executed
Answer: Option B
Solution
Answer: Option B
No explanation is given for this question Let's Discuss on Board