Data Structure Notes in C (Beginner to Exam Level)
1. Array
Array is a collection of elements of same data type stored in contiguous memory locations.
Example:
int arr[5] = {10,20,30,40,50};
2. Stack
Stack follows LIFO (Last In First Out). Operations: Push, Pop.
Example Push:
stack[++top] = value;
3. Queue
Queue follows FIFO (First In First Out). Operations: Enqueue, Dequeue.
Example Enqueue:
queue[++rear] = value;
4. Linked List
Linked List is a collection of nodes connected using pointers.
Example:
struct node { int data; struct node *next; };
5. Searching
Searching is used to find element.
Example: Linear Search, Binary Search
6. Sorting
Sorting is arranging elements.
Example: Bubble Sort, Selection Sort