Dijkstra and Shortest Path Algorithms - Higher Difficulty Problems

Download Q&A
Q. If a graph has negative weight edges, which algorithm should 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 is the purpose of the 'visited' set?
  • A. To store all vertices
  • B. To keep track of the shortest path
  • C. To avoid processing the same vertex multiple times
  • D. To store the distances from the source
Q. What data structure is commonly used to implement the priority queue in Dijkstra's algorithm?
  • A. Array
  • B. Linked List
  • C. Binary Heap
  • D. Stack
Q. What is the primary difference between Dijkstra's algorithm and the A* search algorithm?
  • A. A* uses heuristics, Dijkstra's does not
  • B. Dijkstra's is faster than A*
  • C. A* can only be used on trees
  • D. Dijkstra's algorithm is recursive
Q. Which of the following is a valid application of Dijkstra's algorithm?
  • A. Finding the minimum spanning tree
  • B. Finding the shortest path in a road network
  • C. Finding strongly connected components
  • D. Sorting a list of numbers
Showing 1 to 5 of 5 (1 Pages)
Soulshift Feedback ×

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

Not likely Very likely