(node)
| 22 | } |
| 23 | |
| 24 | addNode(node) { |
| 25 | // Function to add a node to the tree (connection represented by set) |
| 26 | this.connections.set(node, new Set()) |
| 27 | } |
| 28 | |
| 29 | addEdge(node1, node2) { |
| 30 | // Function to add an edge (adds the node too if they are not present in the tree) |