
Concept Notes: Linked Lists in Data Structures
🔹 1. What is a Linked List?
A linked list is a linear data structure where each element (called a node) stores:
- Data
- A pointer to the next node
Unlike arrays, linked lists do not have fixed size and are not stored in contiguous memory.
🔹 2. Node Structur
struct Node {
int data;
struct Node* next;
};
Each node contains:
data
→ the valuenext
→ address of the next node
🔹 3. Types of Linked Lists
Type | Description |
---|---|
Singly Linked List | Each node points to the next. Last node points to NULL. |
Doubly Linked List | Each node has two pointers (next and prev). |
Circular Linked List | Last node points to the first node (making a circle). |
🔹 4. Operations on Linked List
Operation | Description |
---|---|
Insertion | Add node at beginning, middle, end |
Deletion | Remove node by value or position |
Traversal | Visit and print each node |
Searching | Check if a value exists |
🔹 5. Linked List vs Array
Feature | Array | Linked List |
---|---|---|
Memory | Fixed, contiguous | Dynamic, scattered |
Insertion/Del | Costly (shifting) | Efficient (no shifting) |
Random Access | Allowed | Not allowed |
🔹 6. Sample Singly Linked List Diagram
[10|*] → [20|*] → [30|NULL]
Top 10 MCQs – Linked Lists
1️⃣ Which of these is a benefit of Linked Lists over arrays?
A) Constant access time
B) Less memory
C) Dynamic size
D) All of the above
2️⃣ Which pointer type is used in a node structure?
A) int *
B) char *
C) struct Node *
D) float *
3️⃣ What is the default value of the last node’s pointer in a singly linked list?
A) NULL
B) 0
C) address of head
D) same as first node
4️⃣ What is the time complexity to insert a node at the beginning?
A) O(1)
B) O(n)
C) O(log n)
D) O(n²)
5️⃣ Which of the following is NOT a type of linked list?
A) Singly
B) Doubly
C) Circular
D) Binary
6️⃣ Which function is used to visit each node in the list?
A) Delete
B) Traverse
C) Search
D) Loop
7️⃣ How is a node created in C?
A) Node *p = malloc(sizeof(Node));
B) Node p = new Node();
C) int *p = &Node;
D) create_node();
8️⃣ What is the time complexity for searching an element in a linked list?
A) O(1)
B) O(n)
C) O(log n)
D) O(n²)
9️⃣ Which of these uses two pointers per node?
A) Circular
B) Doubly
C) Singly
D) Stack
🔟 What does the head pointer do in a linked list?
A) Stores last node
B) Points to second node
C) Points to first node
D) Points to all nodes
✅ Answer Key
Q.No | Answer |
---|---|
1 | C |
2 | C |
3 | A |
4 | A |
5 | D |
6 | B |
7 | A |
8 | B |
9 | B |
10 | C |
📖 Explanations
- Q1: Linked Lists are dynamic in size.
- Q2:
struct Node*
points to next node. - Q3: Last node points to
NULL
in singly LL. - Q4: Inserting at beginning = O(1)
- Q5: Binary is not a linked list type.
- Q6: Traversal visits each node.
- Q7:
malloc()
allocates memory in C. - Q8: You may have to check all
n
nodes. - Q9: Doubly linked lists use
next
andprev
. - Q10:
head
stores address of first node.
📥 Download Notes + MCQs PDF
Get the full PDF from: @learnnewthingsoffcial
💬 Comment Task
💬 Try creating a struct for a node in C and send your code in the group!