Skip to content

fix: 链表/数组的列表搞反 #26

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 25, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/book/linked_list.md
Original file line number Diff line number Diff line change
Expand Up @@ -491,9 +491,9 @@ console.log(linkedList.count()); // output: 3

| 时间复杂度 | 链表 | 数组 |
| :--------: | :----: | :----: |
| 插入 | `O(n)` | `O(1)` |
| 删除 | `O(n)` | `O(1)` |
| 随机访问 | `O(1)` | `O(n)` |
| 插入 | `O(1)` | `O(n)` |
| 删除 | `O(1)` | `O(n)` |
| 随机访问 | `O(n)` | `O(1)` |

不过数组和链表的性能对比,并不能局限于时间复杂度。在实际的软件开发中,不能仅仅利用复杂度分析就决定使用哪个数据结构来存储数据。

Expand Down
Loading