Linked List – Report
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.
2. Types of Linked Lists
Type Description
Singly Linked List Each node points to the next node
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
3. Structure of a Node (Singly Linked List)
plaintext
CopyEdit
+-----------+------------+
| Data | Next |
+-----------+------------+
Example in Python
python
CopyEdit
class Node:
def __init__(self, data):
self.data = data
self.next = None
# Creating nodes
node1 = Node(10)
node2 = Node(20)
node1.next = node2 # Linking nodes
4. Basic Operations
Operation Time Complexity Description
Insertion at beginning O(1) Insert new node before the head
Insertion at end O(n) Traverse to the end and insert
Deletion O(n) Find and remove a node
Search O(n) Traverse to find an element
Traversal O(n) Visit each node one by one
5. Advantages
• Dynamic size – grows and shrinks at runtime.
• Efficient insertion/deletion – no need to shift elements like in arrays.
• No memory waste – unlike arrays, memory is allocated as needed.
6. Disadvantages
• More memory usage – each node requires a pointer.
• Sequential access only – no direct access like arrays.
• Complexity – harder to implement and debug than arrays.
7. Applications
• Memory management (free lists)
• Implementing stacks and queues
• Navigation systems (e.g., playlist, undo/redo operations)
• Graphs and adjacency lists
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.