mirror of
https://github.com/krahets/hello-algo.git
synced 2025-11-02 04:31:55 +08:00
fix a typo
This commit is contained in:
@ -66,7 +66,7 @@ function find(nums, target) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* Driver Codes*/
|
||||
/* Driver Code */
|
||||
/* 初始化数组 */
|
||||
const arr = new Array(5).fill(0);
|
||||
console.log('数组 arr =', arr);
|
||||
|
||||
@ -53,7 +53,7 @@ class HashMapOpenAddressing {
|
||||
// 若遇到指定 key ,则返回对应 val
|
||||
if (
|
||||
this.#buckets[j].key === key &&
|
||||
this.#buckets[j][key] !== this.#removed.key
|
||||
this.#buckets[j].key !== this.#removed.key
|
||||
)
|
||||
return this.#buckets[j].val;
|
||||
}
|
||||
@ -74,7 +74,7 @@ class HashMapOpenAddressing {
|
||||
// 若遇到空桶、或带有删除标记的桶,则将键值对放入该桶
|
||||
if (
|
||||
this.#buckets[j] === null ||
|
||||
this.#buckets[j][key] === this.#removed.key
|
||||
this.#buckets[j].key === this.#removed.key
|
||||
) {
|
||||
this.#buckets[j] = new Pair(key, val);
|
||||
this.#size += 1;
|
||||
|
||||
Reference in New Issue
Block a user