Skip to content

Commit

Permalink
Merge pull request krahets#123 from iron-irax/patch-1
Browse files Browse the repository at this point in the history
Update hash_map.md
  • Loading branch information
krahets authored Dec 16, 2022
2 parents cbc7840 + 533bde6 commit 8d6e448
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions docs/chapter_hashing/hash_map.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ comments: true

除了哈希表之外,还可以使用以下数据结构来实现上述查询功能:

- **无序数组:** 每个元素为 `[学号, 姓名]`
- **有序数组:**`1.` 中的数组按照学号从小到大排序;
- **链表:** 每个结点的值为 `[学号, 姓名]`
- **二叉搜索树:** 每个结点的值为 `[学号, 姓名]` ,根据学号大小来构建树;
1. **无序数组:** 每个元素为 `[学号, 姓名]`
2. **有序数组:**`1.` 中的数组按照学号从小到大排序;
3. **链表:** 每个结点的值为 `[学号, 姓名]`
4. **二叉搜索树:** 每个结点的值为 `[学号, 姓名]` ,根据学号大小来构建树;

使用上述方法,各项操作的时间复杂度如下表所示(在此不做赘述,详解可见 [二叉搜索树章节](https://www.hello-algo.com/chapter_tree/binary_search_tree/#_6))。无论是查找元素、还是增删元素,哈希表的时间复杂度都是 $O(1)$ ,全面胜出!

Expand Down

0 comments on commit 8d6e448

Please sign in to comment.