Dijkstra and Shortest Path Algorithms - Numerical Applications

Download Q&A
Q. If a graph has negative weight edges, which algorithm should be used instead of Dijkstra's?
  • A. Prim's algorithm
  • B. Kruskal's algorithm
  • C. Bellman-Ford algorithm
  • D. A* algorithm
Q. In a graph represented as an adjacency list, what is the space complexity?
  • A. O(V + E)
  • B. O(V^2)
  • C. O(E)
  • D. O(V)
Q. In which scenario is Dijkstra's algorithm most efficient?
  • A. When all edge weights are equal
  • B. When the graph is sparse
  • C. When the graph is dense
  • D. When there are many negative weights
Q. Which of the following is a key step in Dijkstra's algorithm?
  • A. Updating the distance of adjacent vertices
  • B. Sorting the vertices
  • C. Removing the vertex from the graph
  • D. Adding edges to the graph
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