These notes are derived from the Data Structures and Algorithms in Java: International Student Version 6th Edition by Goodrich, M and Tamassia, R.
Similar to the array data structure, linked-list data structure is a linear data structure meant to storing things in a particular order. Arrays however have a few drawbacks, mainly:
- The capacity of an array is fixed when it's created.
- Insertion & deletions at interior positions of the array can be time-consuming & if many elements need to be shifted.
A linked list resolves these issues through the use of nodes, where each node is connected to the next node.
In the linked list implementation