Linked List Data Structure
A linked list is a data structure consisting of a group of nodes which together represent a sequence. Each
node is composed of a data and a link or reference to the next node in the sequence. This structure allows for efficient
insertion or removal of elements from any position in the sequence.The last node is linked to a terminator used to signify
the end of the list.
Linked lists are the simplest and most common data structures. They can be used to implement several other
abstract data types, including lists, stacks, queues, associative arrays, and S-expressions, etc.
The benefits of a linked list over a conventional array is that the linked list elements can easily be inserted
or removed without reallocation or reorganization of the entire structure because the data items need not be stored contiguously
in memory or on disk. Linked lists allow insertion and removal of nodes at any point in the list.
On the other hand, simple linked lists do not allow random access to the data, or by using indexing. Thus, many
basic operations like obtaining the last node of the list, or finding a node with required data, or locating the place where
a new node should be inserted, may require scanning most of the list elements.