From f628fe27d9ce6fb2a2861dc21fcdb5dd9ce70b21 Mon Sep 17 00:00:00 2001 From: Yudong Jin Date: Mon, 26 Dec 2022 23:12:22 +0800 Subject: [PATCH] Update codes/typescript/chapter_hashing/array_hash_map.ts Co-authored-by: Justin Tse --- codes/typescript/chapter_hashing/array_hash_map.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/codes/typescript/chapter_hashing/array_hash_map.ts b/codes/typescript/chapter_hashing/array_hash_map.ts index ab35d94c3..627205f7f 100644 --- a/codes/typescript/chapter_hashing/array_hash_map.ts +++ b/codes/typescript/chapter_hashing/array_hash_map.ts @@ -41,7 +41,7 @@ class ArrayHashMap { /* 添加操作 */ public set(key: number, val: string) { let index = this.hashFunc(key); - this.bucket[index] = new Entry(index, val); + this.bucket[index] = new Entry(key, val); } /* 删除操作 */