Dijkstra and Shortest Path Algorithms - Advanced Concepts

Download Q&A
Q. In the context of Dijkstra's algorithm, what does 'relaxation' mean?
  • A. Updating the distance to a node if a shorter path is found
  • B. Removing nodes from the graph
  • C. Adding new edges to the graph
  • D. Resetting the algorithm
Q. What condition must be met for Dijkstra's algorithm to work correctly?
  • A. All edge weights must be positive
  • B. The graph must be a tree
  • C. All nodes must be connected
  • D. The graph must be directed
Q. What is the main difference between Dijkstra's algorithm and the Bellman-Ford algorithm?
  • A. Dijkstra's algorithm is faster for all graphs
  • B. Bellman-Ford can handle negative weights, Dijkstra's cannot
  • C. Dijkstra's algorithm is only for directed graphs
  • D. Bellman-Ford is more complex to implement
Q. What is the time complexity of Dijkstra's algorithm using a binary heap?
  • A. O(V^2)
  • B. O(E log V)
  • C. O(V log V)
  • D. O(E + V)
Q. What type of graph representation is most efficient for Dijkstra's algorithm?
  • A. Adjacency matrix
  • B. Adjacency list
  • C. Edge list
  • D. Incidence matrix
Q. Which of the following is a limitation of Dijkstra's algorithm?
  • A. It cannot handle negative weight edges
  • B. It is not efficient for dense graphs
  • C. It cannot find paths in directed graphs
  • D. It requires a complete graph
Showing 1 to 6 of 6 (1 Pages)
Soulshift Feedback ×

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

Not likely Very likely