📞 0339-0387701 (WhatsApp) Contact

« Back to Computer

Which algorithm is used to find the shortest path in a graph?

A. Decision Tree
B. Dijkstra's Algorithm ✅
C. K-Nearest Neighbors
D. None of these

Correct Answer: B. Dijkstra's Algorithm

Explanation

  • Dijkstra's Algorithm is used to find the shortest path between nodes in a graph, especially for weighted graphs.
  • It works by iteratively selecting the closest unvisited node and updating the shortest path estimates.