mirror of
https://github.com/TheAlgorithms/JavaScript.git
synced 2025-07-05 00:01:37 +08:00
fix: updated description comment
This commit is contained in:
@ -1,5 +1,8 @@
|
||||
/*
|
||||
Breadth-first approach can be applied to determine the shortest path between two nodes in an unweighted graph. It searches the target node among all neighbors of the starting node. Then the process is repeated on the level of the neighbors of the neighbors and so on.
|
||||
Breadth-first approach can be applied to determine the shortest path between two nodes
|
||||
in an equi-weighted graph. It searches the target node among all neighbors of the
|
||||
starting node, then the process is repeated on the level of the neighbors of the
|
||||
neighbors and so on.
|
||||
(See also: https://en.wikipedia.org/wiki/Breadth-first_search )
|
||||
(see also: https://www.koderdojo.com/blog/breadth-first-search-and-shortest-path-in-csharp-and-net-core )
|
||||
*/
|
||||
@ -82,4 +85,4 @@ F --> G
|
||||
console.log(breadthFirstShortestPath(graph, 'C', 'E'))
|
||||
console.log(breadthFirstShortestPath(graph, 'E', 'B'))
|
||||
console.log(breadthFirstShortestPath(graph, 'F', 'G'))
|
||||
console.log(breadthFirstShortestPath(graph, 'A', 'G'))
|
||||
console.log(breadthFirstShortestPath(graph, 'A', 'G'))
|
||||
|
Reference in New Issue
Block a user