From 34da35e9f7e74d9a693689aebb13316901964993 Mon Sep 17 00:00:00 2001 From: Bruno Peixoto Date: Mon, 10 Jan 2022 11:46:04 -0300 Subject: [PATCH] (fix) Queue import --- src/algorithms/breadth-first-search/breadthFirstSearch.js | 2 +- src/data-structures/graph/Graph.js | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/algorithms/breadth-first-search/breadthFirstSearch.js b/src/algorithms/breadth-first-search/breadthFirstSearch.js index d4b955ec..babea007 100644 --- a/src/algorithms/breadth-first-search/breadthFirstSearch.js +++ b/src/algorithms/breadth-first-search/breadthFirstSearch.js @@ -1,4 +1,4 @@ -import Queue from '../../../data-structures/queue/Queue'; +import Queue from '../../data-structures/queue/Queue'; /** * @typedef {Object} Callbacks diff --git a/src/data-structures/graph/Graph.js b/src/data-structures/graph/Graph.js index fba65f6d..169febc9 100644 --- a/src/data-structures/graph/Graph.js +++ b/src/data-structures/graph/Graph.js @@ -19,6 +19,14 @@ export default class Graph { return this } + /** + * @param {GraphVertex[]} vertices + * @returns {Graph} + */ + addVertices(newVertices) { + newVertices.forEach((vertex) => this.addVertex(vertex)); + } + /** * @param {string} vertexKey * @returns GraphVertex