图的遍历

function dfs(graph, visited, res, vet) { res.push(vet); visited.add(vet); const adjVets = graph.adjList.get(vet); for (const adjVet of adjVets) { if (
posted @ 2024-04-09 23:27  樊顺  阅读(1)  评论(0编辑  收藏  举报