This commit is contained in:
krahets
2023-02-09 04:43:12 +08:00
parent af3542e3c0
commit 4d2575be7a
18 changed files with 264 additions and 156 deletions
+2 -2
View File
@@ -55,8 +55,8 @@ comments: true
```go title="hashing_search.go"
/* 哈希查找(数组) */
func hashingSearchArray(m map[int]int, target int) int {
// 哈希表的 key: 目标元素,value: 索引
// 若哈希表中无此 key ,返回 -1
// 哈希表的 key: 目标元素,value: 索引
// 若哈希表中无此 key ,返回 -1
if index, ok := m[target]; ok {
return index
} else {