태코놀로지

Linked List - advantages & disadvantages 본문

Data Structure

Linked List - advantages & disadvantages

태코놀로지 2016. 10. 13. 00:28

Advantages

1. Size varies dynamically (dynamic set)

- Unlike the static array (static set) you don't need to reserve a large memory in advance

2. Insertion, deletion, merging, splitting take only constant time (cf. takes linear time for search operation)

- In contrast, array takes linear time (i.e., proportional to the size) for these operations


Disadvantages

1. You cannot access an element using an index

2. Need memories for storing pointers("perv" and "next")

3. Running time for "finding" is proportional to the size of the list (even when a list is sorted!)

Comments