Dijkstra and Shortest Path Algorithms

Download Q&A
Q. In Dijkstra's algorithm, how is the next node to process selected?
  • A. By selecting the node with the highest degree
  • B. By selecting the node with the lowest tentative distance
  • C. By selecting the node that was added last
  • D. By selecting a random node
Q. In Dijkstra's algorithm, what does the 'tentative distance' represent?
  • A. The actual shortest distance found
  • B. The estimated distance to the destination
  • C. The distance from the source to the current node
  • D. The maximum distance in the graph
Q. What happens if Dijkstra's algorithm is applied to a graph with negative weight edges?
  • A. It will still find the shortest path.
  • B. It may produce incorrect results.
  • C. It will not terminate.
  • D. It will find the longest path.
Q. What is the initial value of the tentative distance for the source node in Dijkstra's algorithm?
  • A. Infinity
  • B. 0
  • C. 1
  • D. The weight of the first edge
Q. What is the main limitation of Dijkstra's algorithm?
  • A. It cannot find paths in directed graphs.
  • B. It cannot handle graphs with cycles.
  • C. It cannot handle negative weight edges.
  • D. It is not efficient for large graphs.
Q. What is the primary purpose of Dijkstra's algorithm?
  • A. To find the shortest path in a weighted graph
  • B. To sort an array
  • C. To search for an element in a list
  • D. To traverse a binary tree
Q. What is the time complexity of Dijkstra's algorithm when implemented with a binary heap?
  • A. O(V^2)
  • B. O(E log V)
  • C. O(V log V)
  • D. O(E + V)
Q. Which data structure is commonly used to implement Dijkstra's algorithm?
  • A. Stack
  • B. Queue
  • C. Priority Queue
  • D. Array
Q. Which of the following algorithms can be used instead of Dijkstra's algorithm for graphs with negative weights?
  • A. A* Search
  • B. Bellman-Ford Algorithm
  • C. Floyd-Warshall Algorithm
  • D. Depth-First Search
Q. Which of the following statements is true about Dijkstra's algorithm?
  • A. It can handle negative weight edges.
  • B. It always finds the shortest path.
  • C. It can be used for directed graphs only.
  • D. It requires a complete graph.
Showing 1 to 10 of 10 (1 Pages)
Soulshift Feedback ×

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

Not likely Very likely