queue-typed
Advanced tools
Comparing version 1.41.6 to 1.41.7
@@ -175,3 +175,3 @@ "use strict"; | ||
const dfs = (cur, dest, visiting, path) => { | ||
visiting.set(cur, true); | ||
visiting.add(cur); | ||
if (cur === dest) { | ||
@@ -182,11 +182,11 @@ paths.push([vertex1, ...path]); | ||
for (const neighbor of neighbors) { | ||
if (!visiting.get(neighbor)) { | ||
if (!visiting.has(neighbor)) { | ||
path.push(neighbor); | ||
dfs(neighbor, dest, visiting, path); | ||
(0, utils_1.arrayRemove)(path, (vertex) => vertex === neighbor); | ||
path.pop(); | ||
} | ||
} | ||
visiting.set(cur, false); | ||
visiting.delete(cur); | ||
}; | ||
dfs(vertex1, vertex2, new Map(), []); | ||
dfs(vertex1, vertex2, new Set(), []); | ||
return paths; | ||
@@ -193,0 +193,0 @@ } |
{ | ||
"name": "queue-typed", | ||
"version": "1.41.6", | ||
"version": "1.41.7", | ||
"description": "Queue, ArrayQueue. Javascript & Typescript Data Structure.", | ||
@@ -118,4 +118,4 @@ "main": "dist/index.js", | ||
"dependencies": { | ||
"data-structure-typed": "^1.41.6" | ||
"data-structure-typed": "^1.41.7" | ||
} | ||
} |
@@ -236,4 +236,4 @@ /** | ||
const dfs = (cur: VO, dest: VO, visiting: Map<VO, boolean>, path: VO[]) => { | ||
visiting.set(cur, true); | ||
const dfs = (cur: VO, dest: VO, visiting: Set<VO>, path: VO[]) => { | ||
visiting.add(cur); | ||
@@ -246,13 +246,13 @@ if (cur === dest) { | ||
for (const neighbor of neighbors) { | ||
if (!visiting.get(neighbor)) { | ||
if (!visiting.has(neighbor)) { | ||
path.push(neighbor); | ||
dfs(neighbor, dest, visiting, path); | ||
arrayRemove(path, (vertex: VO) => vertex === neighbor); | ||
path.pop(); | ||
} | ||
} | ||
visiting.set(cur, false); | ||
visiting.delete(cur); | ||
}; | ||
dfs(vertex1, vertex2, new Map<VO, boolean>(), []); | ||
dfs(vertex1, vertex2, new Set<VO>(), []); | ||
return paths; | ||
@@ -259,0 +259,0 @@ } |
1374065
Updateddata-structure-typed@^1.41.7