Dijkstra and Shortest Path Algorithms - Typical Problems - Higher Difficulty Problems

Download Q&A
Q. If a graph has negative edge weights, which algorithm can be used instead of Dijkstra's algorithm?
  • A. Prim's Algorithm
  • B. Kruskal's Algorithm
  • C. Bellman-Ford Algorithm
  • D. Floyd-Warshall Algorithm
Q. In Dijkstra's algorithm, what condition must be met for a vertex to be added to the set of visited vertices?
  • A. It must have the smallest edge weight
  • B. It must be the last vertex processed
  • C. It must be connected to the source
  • D. It must have the highest degree
Q. What happens if Dijkstra's algorithm is run on a graph with a negative weight cycle?
  • A. It will return the correct shortest path
  • B. It will enter an infinite loop
  • C. It will terminate with an error
  • D. It may return incorrect results
Q. Which of the following data structures is most efficient for implementing Dijkstra's algorithm?
  • A. Array
  • B. Linked List
  • C. Binary Heap
  • D. Stack
Showing 1 to 4 of 4 (1 Pages)
Soulshift Feedback ×

On a scale of 0–10, how likely are you to recommend The Soulshift Academy?

Not likely Very likely