Advantages and disadvantages of sequential lists and linked lists

Sequence table:

Advantages:
1. Continuous space
2. Support random access
3. High space utilization, not easy to cause memory fragmentation
4. High efficiency of tail insertion and deletion

Disadvantages:
1. The head plug is deleted, the middle is inserted, and the deletion efficiency is low. It is not suitable for insertion and deletion
at these positions 2. High cost of capacity expansion: application, copy, release

Linked list (two-way lead loop)

Advantages:
1. Insert at any position, high deletion efficiency
2. High space utilization (apply if you use it, don’t not apply)

Disadvantages:
1. The space is not continuous, which is easy to cause memory fragmentation
2. No random access

Guess you like

Origin blog.csdn.net/weixin_52270223/article/details/111321907