Shortest-Path

Question 1

Which one of the following algorithm design techniques is used in finding all pairs of shortest distances in a graph?

A
Dynamic programming
B
Backtracking
C
Greedy
D
Divide and Conquer
Question 1 Explanation: 
In Dynamic programming Floyd Warshall algorithm is used to calculate the all pairs shortest path distance.
Question 2

Suppose we run Dijkstra’s single source shortest-path algorithm on the following edge weighted directed graph with vertex P as the source. In what order do the nodes get included into the set of vertices for which the shortest path distances are finalized?

A
P, Q, R, S, T, U
B
P, Q, R, U, S, T
C
P, Q, R, U, T, S
D
P, Q, T, R, U, S
Question 2 Explanation: 

P, Q, R, U, S, T
There are 2 questions to complete.

Access quiz wise question and answers by becoming as a solutions adda PRO SUBSCRIBER with Ad-Free content

Register Now

If you have registered and made your payment please contact solutionsadda.in@gmail.com to get access