A linked list is a linear data structure, in which the elements are not stored at contiguous memory locations. The elements in a linked list are linked using pointers. In simple words, a linked list consists of nodes where each node contains a data field and a reference(link) to the next node in the list.
A linked list is represented by a pointer to the first node of the linked list. The first node is called the head. If the linked list is empty, then the value of the head points to NULL.
Each node in the linked list has at least two parts:
- Data/value like string, integer or data of any type
- Pointer/Reference to the next node
Note: read about linked lists vs arrays
Linked List Traversal:
Iterative
Recursive
Sum of Linked List:
Iterative
Recursive
Find a Value in a Linked List
Iterative
Recursive
Get the Node Value:
Iterative
Recursive
Reverse a Linked List
Iterative
Recursive
Merging Lists (Zipper list problem)
Iterative
Recursive
All the Sources: