File tree 2 files changed +3
-3
lines changed 2 files changed +3
-3
lines changed Original file line number Diff line number Diff line change 1
- class GraphUnweightedUndirected {
1
+ class GraphUnweightedUndirectedAdjacencyList {
2
2
// Unweighted Undirected Graph class
3
3
constructor ( ) {
4
4
this . connections = { }
@@ -46,7 +46,7 @@ class GraphUnweightedUndirected {
46
46
}
47
47
48
48
function main ( ) {
49
- const graph = new GraphUnweightedUndirected ( )
49
+ const graph = new GraphUnweightedUndirectedAdjacencyList ( )
50
50
graph . addEdge ( 1 , 2 ) // Component 1
51
51
graph . addEdge ( 3 , 4 ) // Component 2
52
52
graph . addEdge ( 3 , 5 ) // Component 2
Original file line number Diff line number Diff line change @@ -163,7 +163,7 @@ class GraphWeightedUndirectedAdjacencyList {
163
163
}
164
164
165
165
PrimMST ( start ) {
166
- // Kruskal 's Algorithm to generate a Minimum Spanning Tree (MST) of a graph
166
+ // Prim 's Algorithm to generate a Minimum Spanning Tree (MST) of a graph
167
167
// Details: https://en.wikipedia.org/wiki/Prim%27s_algorithm
168
168
const distance = { }
169
169
const parent = { }
You can’t perform that action at this time.
0 commit comments