File tree Expand file tree Collapse file tree 2 files changed +3
-3
lines changed
Expand file tree Collapse file tree 2 files changed +3
-3
lines changed Original file line number Diff line number Diff line change 1- class GraphUnweightedUndirected {
1+ class GraphUnweightedUndirectedAdjacencyList {
22 // Unweighted Undirected Graph class
33 constructor ( ) {
44 this . connections = { }
@@ -46,7 +46,7 @@ class GraphUnweightedUndirected {
4646}
4747
4848function main ( ) {
49- const graph = new GraphUnweightedUndirected ( )
49+ const graph = new GraphUnweightedUndirectedAdjacencyList ( )
5050 graph . addEdge ( 1 , 2 ) // Component 1
5151 graph . addEdge ( 3 , 4 ) // Component 2
5252 graph . addEdge ( 3 , 5 ) // Component 2
Original file line number Diff line number Diff line change @@ -163,7 +163,7 @@ class GraphWeightedUndirectedAdjacencyList {
163163 }
164164
165165 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
167167 // Details: https://en.wikipedia.org/wiki/Prim%27s_algorithm
168168 const distance = { }
169169 const parent = { }
You can’t perform that action at this time.
0 commit comments