Linked Lists
Linked lists are similar to arrays, thhey both store data, but linked lists consist of nodes that contain a reference to the next node in the list. Basically, a linked list is an ordered list of data. Although the traversal is sequential and so the worst case is that it takes O(n) times to find an element, these is a major advantage of this to an array. The size of the list is not need to be known in advance. This means you may add up to infinite elements to the list, while once arrays are full, nothing can be added.
No comments:
Post a Comment