Dijkstra's Algorithm Quiz
Dijkstra's Algorithm Quiz
a) Sorting numbers
3. What data structure is commonly used in Dijkstra's algorithm to find the next
closest vertex?
a) Stack
b) Queue
d) Linked List
4. What determines the order in which vertices are processed in Dijkstra’s algorithm?
a) The vertex with the smallest distance from the source is processed first.
c) The vertex with the largest distance from the source is processed first.
5. In Dijkstra's algorithm, what is initialized to infinity (\( \infty \)) at the start?
b) Zero-weight edges
d) Cycles
Answer: a) It does not work with graphs containing negative weight edges.
c) It skips vertices
b) Sorting algorithms
13. How does Dijkstra’s algorithm choose the next node to process?
a) Randomly
d) By alphabetical order
14. What happens if a graph has disconnected components when using Dijkstra’s
algorithm?
c) It outputs an error
d) It stops immediately
15. What happens when Dijkstra’s algorithm encounters a node with a smaller path
than previously found?
a) It updates the node’s distance
b) It stops processing
c) It deletes the node from the graph
d) It ignores the node
Answer: a) It updates the node’s distance
16. What is an optimal data structure for Dijkstra’s algorithm when using a priority
queue?
a) Array
b) Binary heap
c) Stack
d) Queue
Answer: b) Binary heap
a) Edsger W. Dijkstra
b) Arthur N. Dijkstra
c) Dijkstra Armstrong
d) Adolf Dijkstra
a) 1965
b) 1956
c) 1966
d) 1966
Answer: b) 1956
19. Dijkstra’s algorithm is a computer science algorithm that finds the shortest path
between ______ in a weighted graph.
a) lines
b) curves
c) nodes
d) circles
Answer: c) nodes
a) Google Maps
b) Canva
c) Telegram
d) Tiktok