Linked List
Linked List
1. Introduction
A linked list is a linear data structure in which elements (called nodes) are stored in non-
contiguous memory locations. Each node contains data and a reference (pointer) to the next node
in the sequence. Unlike arrays, linked lists allow dynamic memory allocation and efficient
insertion/deletion.
Type Description
Doubly Linked List Each node points to both previous and next nodes
Circular Linked List The last node points back to the head, forming a circle
plaintext
CopyEdit
+-----------+------------+
| Data | Next |
+-----------+------------+
Example in Python
python
CopyEdit
class Node:
self.data = data
self.next = None
# Creating nodes
node1 = Node(10)
node2 = Node(20)
5. Advantages
6. Disadvantages
7. Applications
8. Real-World Analogy
A linked train: each car (node) is connected to the next. You cannot jump to a specific car without
going through the previous ones.