We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1507c47 commit 70e605bCopy full SHA for 70e605b
graph/prim.ts
@@ -24,7 +24,7 @@ export const prim = (graph: [number, number][][]): [Edge[], number] => {
24
add_children(graph, priorityQueue, 0);
25
26
while (!priorityQueue.isEmpty()) {
27
- // We always store the previously visited edge in `edge.a`, and the newly visited node in `edge.b`.
+ // We have already visited vertex `edge.a`. If we have not visited `edge.b` yet, we add its outgoing edges to the PriorityQueue.
28
let edge = priorityQueue.extract();
29
if (visited.has(edge.b)) {
30
continue;
0 commit comments