What is the primary purpose of Dijkstra's algorithm?

  • Finding the shortest path between two nodes in a graph
  • Generating random numbers
  • Sorting elements in an array
  • Traversing a linked list
The primary purpose of Dijkstra's algorithm is to find the shortest path between two nodes in a graph, particularly in a graph with non-negative edge weights. It is commonly used in routing and network protocols.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *