<<< Other data structures | Index | Doubly-linked vs. singly-linked >>> |
Linked lists have specific advantages over arrays:
Nodes can be inserted into linked list indefinitely;
Array will eventually fill up and needs to be resized.
(an expensive operation that may not even be possible if memory is fragmented.)
On the other hand,
arrays allow random access
linked lists allow only sequential access to elements.
(Singly-linked lists, in fact, can only be traversed in one direction.)
<<< Other data structures | Index | Doubly-linked vs. singly-linked >>> |