Skip to content

Commit

Permalink
Update docs/chapter_searching/hashing_search.md
Browse files Browse the repository at this point in the history
Co-authored-by: Justin Tse <[email protected]>
  • Loading branch information
zhuoqinyue and justin-tse authored Jan 11, 2023
1 parent 5508972 commit c6f6fa0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions docs/chapter_searching/hashing_search.md
Original file line number Diff line number Diff line change
Expand Up @@ -173,10 +173,10 @@ comments: true

```typescript title="hashing_search.ts"
/* 哈希查找(链表) */
function hashingSearch1(map: Map<number, any>, target: number) {
function hashingSearch1(map: Map<number, ListNode>, 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;
}
```

Expand Down

0 comments on commit c6f6fa0

Please sign in to comment.