Q. How does Dijkstra's algorithm update the tentative distances of neighboring nodes?
-
A.
By adding the edge weights to the current node's distance
-
B.
By multiplying the edge weights with the current node's distance
-
C.
By subtracting the edge weights from the current node's distance
-
D.
By ignoring the edge weights
Solution
Dijkstra's algorithm updates the tentative distances of neighboring nodes by adding the edge weights to the current node's distance.
Correct Answer:
A
— By adding the edge weights to the current node's distance
Learn More →
Q. What is the initial value assigned to the tentative distance of the source node in Dijkstra's algorithm?
-
A.
Infinity
-
B.
Zero
-
C.
One
-
D.
Negative infinity
Solution
The tentative distance of the source node is initialized to zero, as it is the starting point of the path.
Correct Answer:
B
— Zero
Learn More →
Q. Which of the following is an application of Dijkstra's algorithm?
-
A.
Finding the shortest route in GPS navigation
-
B.
Sorting a list of numbers
-
C.
Searching for an element in a binary search tree
-
D.
Calculating the factorial of a number
Solution
Dijkstra's algorithm is commonly used in GPS navigation systems to find the shortest route between locations.
Correct Answer:
A
— Finding the shortest route in GPS navigation
Learn More →
Showing 1 to 3 of 3 (1 Pages)