A Data Structure is a way of organizing, storing, and managing data in a computer so that it can be accessed and modified efficiently.
It helps in:
A data structure decides how data is arranged in memory.
Two Data Structures I Have Used (With Examples)
1. Array
An Array is a linear data structure that stores elements of the same type in continuous memory locations.
Here:
Where it is used:
Advantage: Fast access using index number.
Limitation: Fixed size.
2. Linked List
A Linked List is a linear data structure where elements (nodes) are connected using pointers. Each node contains:
Example:
Suppose we store numbers:
10 → 20 → 30
Each element points to the next element.
Where it is used:
Advantage: Dynamic size (can grow or shrink).
Limitation: No direct index access.