mirror of
https://github.com/TheAlgorithms/JavaScript.git
synced 2025-12-19 06:58:15 +08:00
Remove live code & console.log, leave examples as comments (Geometry, Graphs, Maths).
This commit is contained in:
@@ -45,12 +45,12 @@ class GraphUnweightedUndirectedAdjacencyList {
|
||||
}
|
||||
}
|
||||
|
||||
function main () {
|
||||
const graph = new GraphUnweightedUndirectedAdjacencyList()
|
||||
graph.addEdge(1, 2) // Component 1
|
||||
graph.addEdge(3, 4) // Component 2
|
||||
graph.addEdge(3, 5) // Component 2
|
||||
console.log(graph.connectedComponents())
|
||||
}
|
||||
export { GraphUnweightedUndirectedAdjacencyList }
|
||||
|
||||
main()
|
||||
// Example
|
||||
|
||||
// const graph = new GraphUnweightedUndirectedAdjacencyList()
|
||||
// graph.addEdge(1, 2) // Component 1
|
||||
// graph.addEdge(3, 4) // Component 2
|
||||
// graph.addEdge(3, 5) // Component 2
|
||||
// const components = graph.connectedComponents()
|
||||
|
||||
Reference in New Issue
Block a user