Open
Description
Take Breadth-First Search/tree.js (shown below) as an example.
The input to the BFS algorithm is a graph (or tree) and a starting node, while the BFS
function only takes the starting node s
as parameter, leaving the graph G
as a global variable. In my humble opinion, it would be better to avoid such mismatch, which can potentially confuse learners.
Note: This mismatch also appears in some other algorithm code.
algorithms/Brute Force/Breadth-First Search/tree.js
Lines 1 to 50 in fe3adcf
Metadata
Metadata
Assignees
Labels
No labels