Ayush7-BIT / turbo-robot

"A collection of essential coding algorithms and popular code solutions. Optimized for interviews and competitive programming, covering a wide range of topics from sorting to dynamic programming.”
18 stars 239 forks source link

Adding Djikstra algorithm using Java #421

Open DinkyRajpoot56 opened 3 days ago

DinkyRajpoot56 commented 3 days ago

Dijkstra's algorithm is often considered to be the most straightforward algorithm for solving the shortest path problem.

Dijkstra's algorithm is used for solving single-source shortest path problems for directed or undirected paths. Single-source means that one vertex is chosen to be the start, and the algorithm will find the shortest path from that vertex to all other vertices.

Dijkstra's algorithm does not work for graphs with negative edges. For graphs with negative edges, the Bellman-Ford algorithm that is described on the next page, can be used instead.

To find the shortest path, Dijkstra's algorithm needs to know which vertex is the source, it needs a way to mark vertices as visited, and it needs an overview of the current shortest distance to each vertex as it works its way through the graph, updating these distances when a shorter distance is found..Its an important Data Structures

DinkyRajpoot56 commented 3 days ago

Please assign me in this issue

AbhayGoyal001 commented 1 day ago

@Ayush7-BIT Please review my code and merge