Skip to content
New issue

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

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

Already on GitHub? # to your account

数组与链表的区别 #98

Open
nmsn opened this issue Sep 7, 2023 · 1 comment
Open

数组与链表的区别 #98

nmsn opened this issue Sep 7, 2023 · 1 comment

Comments

@nmsn
Copy link
Contributor

nmsn commented Sep 7, 2023

No description provided.

@nmsn
Copy link
Contributor Author

nmsn commented Sep 7, 2023

数组

查询效率高,新增和修改需要移动元素效率低,内存分配是连续的内存,扩容需要重新分配内存。

链表

新增和修改效率高,只需要修改指针指向就好。链表查询效率低,需要从链表头依次查找。
内存分配不需要连续的内存,占用连续内存少。

# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

No branches or pull requests

1 participant