From 55089726d607ff29f905588b49694ce011eb0f3d Mon Sep 17 00:00:00 2001 From: zhuoqinyue <64182179+zhuoqinyue@users.noreply.github.com> Date: Wed, 11 Jan 2023 14:12:57 +0800 Subject: [PATCH] Update codes/typescript/chapter_searching/hashing_search.ts Co-authored-by: Justin Tse --- codes/typescript/chapter_searching/hashing_search.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/codes/typescript/chapter_searching/hashing_search.ts b/codes/typescript/chapter_searching/hashing_search.ts index ef0245a9..6133942b 100644 --- a/codes/typescript/chapter_searching/hashing_search.ts +++ b/codes/typescript/chapter_searching/hashing_search.ts @@ -16,10 +16,10 @@ function hashingSearch(map: Map, target: number) { } /* 哈希查找(链表) */ -function hashingSearch1(map: Map, target: number) { +function hashingSearch1(map: Map, target: number): ListNode | null { // 哈希表的 key: 目标结点值,value: 结点对象 // 若哈希表中无此 key ,返回 null - return map.has(target) ? map.get(target) : null; + return map.has(target) ? map.get(target) as ListNode : null; } function main() {