Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Graphs/ConnectedComponents.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
class GraphUnweightedUndirected {
class GraphUnweightedUndirectedAdjacencyList {
// Unweighted Undirected Graph class
constructor () {
this.connections = {}
Expand Down Expand Up @@ -46,7 +46,7 @@ class GraphUnweightedUndirected {
}

function main () {
const graph = new GraphUnweightedUndirected()
const graph = new GraphUnweightedUndirectedAdjacencyList()
graph.addEdge(1, 2) // Component 1
graph.addEdge(3, 4) // Component 2
graph.addEdge(3, 5) // Component 2
Expand Down
2 changes: 1 addition & 1 deletion Graphs/PrimMST.js
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ class GraphWeightedUndirectedAdjacencyList {
}

PrimMST (start) {
// Kruskal's Algorithm to generate a Minimum Spanning Tree (MST) of a graph
// Prim's Algorithm to generate a Minimum Spanning Tree (MST) of a graph
// Details: https://en.wikipedia.org/wiki/Prim%27s_algorithm
const distance = {}
const parent = {}
Expand Down