Dijkstra’s Algorithm Multiple choice Questions and Answers (MCQs)

 

 Help authour, Buy PDF Ebook   >>>Click Here<<<

Dijkstra's Algorithm Multiple choice Questions and Answers (MCQs)

Click on any option to know the CORRECT ANSWERS

Question 1
Dijkstra's Algorithm is used to solve ..... problems.
A
All pair shortest path
B
Single source shortest path
C
Network flow
D
Sorting
UPSC test Questions answers

Question 1 Explanation: 
Dijkstra's Algorithm is used for solving single source shortest path problems. In this algorithm, a single node is fixed as a source node and shortest paths from this node to all other nodes in graph is found.

Question 2
Which of the following is the most commonly used data structure for implementing Dijkstra's Algorithm?
A
Max priority queue
B
Stack
C
Circular queue
D
Min priority queue
GK Questions answers

Question 2 Explanation: 
Minimum priority queue is the most commonly used data structure for implementing Dijkstra's Algorithm because the required operations to be performed in Dijkstra's Algorithm match with specialty of a minimum priority queue.

Question 3
What is the time complexity of Dijikstra's algorithm?
A
O(N)
B
O(N3)
C
O(N2)
D
O(logN)
Biology Questions answers

Question 3 Explanation: 
Time complexity of Dijkstra's algorithm is O(N2) because of the use of doubly nested for loops. It depends on how the table is manipulated.

Question 4
Dijkstra's Algorithm cannot be applied on .....
A
Directed and weighted graphs
B
Graphs having negative weight function
C
Unweighted graphs
D
Undirected and unweighted graphs
Public administration Questions answers

Question 4 Explanation: 
Dijkstra's Algorithm cannot be applied on graphs having negative weight function because calculation of cost to reach a destination node from the source node becomes complex.

Question 5
What is the pseudo code to compute the shortest path in Dijkstra's algorithm?
A

if(!T[w].Known) 	if(T[v].Dist + C(v, w) < T[w].Dist) { Decrease(T[w].Dist to 
B

if(T[w].Known) 	if(T[v].Dist + C(v, w) < T[w].Dist) { Increase (T[w].Dist to T[
C

if(!T[w].Known) 	if(T[v].Dist + C(v, w) > T[w].Dist) { Decrease(T[w].Dis
D

if(T[w].Known) 	if(T[v].Dist + C(v, w) < T[w].Dist) { Increase(T[w].Dist to T[v
Library science Questions answers

Question 5 Explanation: 
If the known value of the adjacent vertex(w) is not set then check whether the sum of distance from source vertex(v) and cost to travel from source to adjacent vertex is less than the existing distance of the adjacent node. If so, perform decrease key operation.

There are 5 questions to complete.

 

 Download all FREE PDF Ebook >>>CLICK HERE<<<