From 1d72cbb27329376f4998a0d7ce3bedff2c49153e Mon Sep 17 00:00:00 2001 From: Rodrigo Morais <58960796+rodigu@users.noreply.github.com> Date: Sun, 17 Jan 2021 01:11:13 -0300 Subject: [PATCH] Update Graphs/NodeNeighbors.js Co-authored-by: Tapajyoti Bose <44058757+ruppysuppy@users.noreply.github.com> --- Graphs/NodeNeighbors.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Graphs/NodeNeighbors.js b/Graphs/NodeNeighbors.js index 473cdf0f1..74d582525 100644 --- a/Graphs/NodeNeighbors.js +++ b/Graphs/NodeNeighbors.js @@ -16,7 +16,7 @@ class Graph { nodeNeighbors (node) { // Returns an array with all of the node neighbors - const neighbors = [] + const neighbors = new Set() for (let i = 0; i < this.edges.length; i++) { // Checks if they have an edge between them and if the neighbor is not // already in the neighbors array