✅ Types of Linked Lists
✅ 1. Introduction
A Linked List is a dynamic linear data structure made up of nodes, where each node contains data and one or more links (pointers) to other nodes.
Based on how these nodes are connected, linked lists are classified into different types.
✅ 2. Types of Linked Lists
The main types of linked lists are:
- Singly Linked List
- Doubly Linked List
- Circular Linked List
- Circular Doubly Linked List
✅ 3. Singly Linked List
✅ Definition
A Singly Linked List is a linked list in which each node contains:
- Data part
- One pointer pointing to the next node
📌 The last node points to NULL, which indicates the end of the list.
✅ Representation
HEAD → [Data|Next] → [Data|Next] → [Data|NULL]
✅ Node Structure (C)
struct node
{
int data;
struct node *next;
};
✅ Features
- Traversal is possible only in one direction
- Requires less memory than doubly linked list
- Simple to implement
✅ Advantages
- Dynamic size
- Efficient insertion and deletion
- No need for contiguous memory
❌ Disadvantages
- Cannot traverse backward
- Searching is slow
- No direct access
✅ Applications
- Stack implementation
- Queue implementation
- Polynomial representation
✅ 4. Doubly Linked List
✅ Definition
A Doubly Linked List is a linked list in which each node contains:
- Data part
- Two pointers:
prev→ address of previous nodenext→ address of next node
✅ Representation
NULL ← [Prev|Data|Next] ↔ [Prev|Data|Next] → NULL
✅ Node Structure (C)
struct dnode
{
int data;
struct dnode *prev;
struct dnode *next;
};
✅ Features
- Traversal is possible in both directions
- More flexible than singly linked list
✅ Advantages
- Easy backward traversal
- Deletion is easier (no need to track previous node)
- Useful for navigation systems
❌ Disadvantages
- Requires extra memory
- More complex than singly linked list
✅ Applications
- Browser forward/backward navigation
- Undo/Redo operations
- Music player (previous/next song)
✅ 5. Circular Linked List
✅ Definition
A Circular Linked List is a linked list in which the last node points back to the first node instead of pointing to NULL.
📌 There is no NULL pointer in circular linked list.
✅ Representation
HEAD → [Data|Next] → [Data|Next] → [Data|Next]
↑ ↓
←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←
✅ Node Structure
Same as singly linked list:
struct node
{
int data;
struct node *next;
};
✅ Features
- Traversal starts from any node
- Last node links to first node
✅ Advantages
- No NULL pointer
- Efficient for circular operations
- Useful in round-robin scheduling
❌ Disadvantages
- Complex traversal (need stopping condition)
- Difficult to detect end of list
✅ Applications
- CPU scheduling (Round Robin)
- Multiplayer games
- Circular queues
✅ 6. Circular Doubly Linked List
✅ Definition
A Circular Doubly Linked List is a combination of:
- Doubly linked list
- Circular linked list
Each node has:
prevpointernextpointer
And:
- Last node’s
nextpoints to first node - First node’s
prevpoints to last node
✅ Representation
↔ [Prev|Data|Next] ↔ [Prev|Data|Next] ↔
↑ ↓
←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←
✅ Advantages
- Traversal in both directions
- Efficient insertion and deletion
- No NULL pointer
❌ Disadvantages
- High memory usage
- Complex implementation
✅ Applications
- Advanced scheduling systems
- Navigation systems
- Real-time applications
✅ 7. Comparison of Types of Linked Lists (Quick View)
| Type | Pointers per Node | Traversal | Last Node |
|---|---|---|---|
| Singly Linked List | 1 | Forward only | Points to NULL |
| Doubly Linked List | 2 | Forward & Backward | Points to NULL |
| Circular Linked List | 1 | Circular Forward | Points to First Node |
| Circular Doubly Linked List | 2 | Circular Both Ways | Points to First Node |
✅ Conclusion
Linked lists are classified based on how nodes are connected.
- Singly linked lists are simple and memory efficient.
- Doubly linked lists support two-way traversal.
- Circular linked lists eliminate NULL pointers and are useful for cyclic operations.
- Circular doubly linked lists provide maximum flexibility but need more memory.
