Update docs/chapter_searching/hashing_search.md
Co-authored-by: Justin Tse <xiefahit@gmail.com>
This commit is contained in:
parent
55089726d6
commit
c6f6fa0015
@ -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;
|
||||
}
|
||||
```
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user