Data Structures
Computers · डेटा संरचनाएं
📋Quick Overview
A data structure is a way of organizing and storing data for efficient access and modification. Common types include Arrays, Linked Lists, Stacks, Queues, Trees, and Graphs. Stack follows LIFO (Last In First Out) and Queue follows FIFO (First In First Out). Data structures are fundamental to computer science and algorithms.
⭐
Stack = LIFO (Last In First Out) like a stack of plates; Queue = FIFO (First In First Out) like a line
⭐
Array: fixed-size, indexed collection; Linked List: dynamic-size, uses pointers
📖Data Structures
| Structure | Type | Key Property |
|---|---|---|
| Array | Linear | Fixed size, indexed, O(1) access |
| Linked List | Linear | Dynamic size, pointer-based |
| Stack | Linear | LIFO — push/pop operations |
| Queue | Linear | FIFO — enqueue/dequeue |
| Tree | Non-linear | Hierarchical — root, branches, leaves |
| Binary Tree | Non-linear | Max 2 children per node |
| Graph | Non-linear | Nodes + edges, network representation |
| Hash Table | Non-linear | Key-value pairs, O(1) average lookup |
📝Key Points
- •Array: Fixed size, indexed, O(1) access
- •Linked List: Dynamic size, pointer-based
- •Stack: LIFO — push/pop operations
- •Queue: FIFO — enqueue/dequeue
- •Tree: Hierarchical — root, branches, leaves
- •Binary Tree: Max 2 children per node