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.
Loading...
Related Quiz
- In which scenarios is DFS typically preferred over BFS?
- What are the advantages and disadvantages of using linear search compared to other search algorithms?
- What is the objective of Prim's and Kruskal's algorithms?
- In DFS, _______ is used to mark nodes as visited.
- Explain the basic concept of Breadth-First Search (BFS).