Linked List: Introduction And Types
A linked list is a linear data structure in which elements are linked together using nodes. More generally, linked list is a collection of nodes where each node consists of two parts, ‘data’ and ‘link’ .
- data: the actual element to be stored in list.
- link: one or two links that point to next and previous node of list using pointer.
Unlike arrays, linked list elements are not stored at a contiguous location; the elements are linked using pointers.
Facts About Linked List
- The nodes of linked list are not stored contiguously in computer memory.
- No need to shift any element in list to insert or delete element.
- Memory for each node can be allocated whenever the need arises.
- The size of a linked list can grow or shrink dynamically.
Operations On Linked List
- Creation: Create a linked list
- Insertion : at the beginning, at the end, at the specified position
- Deletion: at the beginning, at the end, at the specified position
- Traversing: The process of getting through all nodes of linked list from one end to another. It may be forward or backward.
- Searching: Find an element in the list.
- Concatenation: Appending second list to the end of first.
Types Of Linked List
- Singly(Linear) Linked List
- Doubly Linked List
- Circular Linked List
- Circular Doubly Linked List