Advertisements
Advertisements
प्रश्न
Explain a linked list with suitable example having six nodes with properly labeled diagram.
कोड लेखन
आकृति
स्पष्ट कीजिए
Advertisements
उत्तर
A linked list is a linear data structure in which elements are not stored in contiguous memory locations. Each element, called a node, contains two parts:
- Data – stores the value
- Next (Link/Pointer) – stores the address of the next node
The last node points to NULL, indicating the end of the list.
struct Node
{
int data;
Node* next;
};
Example: Linked List with Six Nodes
Let us create a linked list containing six values:
10, 20, 30, 40, 50, 60
Properly Labelled Diagram

Explanation of the Diagram:
- HEAD stores the address of the first node.
- Each node has two fields:
- Left part → Data
- Right part → Next pointer
- Each node points to the next node in sequence.
- The last node points to NULL, showing the end of the list.
shaalaa.com
क्या इस प्रश्न या उत्तर में कोई त्रुटि है?
2024-2025 (July) Official Board Paper
