feat: Add glossary and description for "哈希集合" (#1310)

This commit is contained in:
Yudong Jin
2024-04-28 22:00:25 +08:00
committed by GitHub
parent a88c7b9862
commit cfc273783b
28 changed files with 36 additions and 31 deletions
+1 -1
View File
@@ -12,7 +12,7 @@ import utils
func graphBFS(graph: GraphAdjList, startVet: Vertex) -> [Vertex] {
//
var res: [Vertex] = []
// 访
// 访
var visited: Set<Vertex> = [startVet]
// BFS
var que: [Vertex] = [startVet]
+1 -1
View File
@@ -26,7 +26,7 @@ func dfs(graph: GraphAdjList, visited: inout Set<Vertex>, res: inout [Vertex], v
func graphDFS(graph: GraphAdjList, startVet: Vertex) -> [Vertex] {
//
var res: [Vertex] = []
// 访
// 访
var visited: Set<Vertex> = []
dfs(graph: graph, visited: &visited, res: &res, vet: startVet)
return res