In Computer Terms, A data structure is a Specific way to store and organize in a computer's memory so that these data can be use efficiently later.
- Linear Vs Non-Linear Data Structure
- Homogenous Vs Non-Homogenous Data Structure
- Static Vs Dynamic
- Primitive Vs Non-Primitive
Array are collection of Homogenous Elements in Continious Order
- It is Linear
- It is Homogenous
- It is Static
- It is Non-Primitive
Elements
| A | B | C | D |
|---|---|---|---|
| 0 | 1 | 2 | 3 |
Index
// Initialization of Array
int Arr[]= {1,2,3,4,5};
// Array Declaration
int Arr[Size_Of_Array];
It is Collection of Nodes Where node has a Two Part First Part is Info And The second Part is Link.
In Info, The Value is Stored and,
In Link Part, Address of next Node is stored.
There is a Special Pointer Which stores the address of Fist Node called START
and a Special Pointer Which stores NULL in Link called END
| Info | Link |
|---|
// Structure of Node
struct Node{
int info; // INFO Part (can store any value)
struct Node * Link; // Link Part (Stores The address of Next Node)
}
It is based on LIFO, Last in First out , where insertion and deletion take place at one end Called Top.
Insertion is known as PUSH
Deletion is Known as POP
STACK
| B |
| C |
| D |
It is Based On Fifo , where insertion take place at rare end and deletion take place at front End;
It is a Hierarchical representation of Data