Skip to content

Commit 19389a8

Browse files
authored
Create README.md
1 parent 3cfc6be commit 19389a8

1 file changed

Lines changed: 38 additions & 0 deletions

File tree

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# 🚶 Queue — Linear Data Structure
2+
3+
## 🎯 Concept
4+
Queue follows **FIFO (First In, First Out)** — the first inserted element is removed first.
5+
6+
---
7+
8+
## ⚙️ Core Operations
9+
10+
| Operation | Description | Time Complexity |
11+
|------------|--------------|-----------------|
12+
| `enqueue()` | Add element to rear | O(1) |
13+
| `dequeue()` | Remove element from front | O(1) |
14+
| `peek()` | View front element | O(1) |
15+
| `isEmpty()` | Check if queue is empty | O(1) |
16+
17+
---
18+
19+
## 🧠 Real-Life Analogies
20+
- People waiting in line at a counter.
21+
- Printer job queue.
22+
- CPU process scheduling.
23+
24+
---
25+
26+
## 🧩 Variants
27+
- **Circular Queue** – Reuses space efficiently.
28+
- **Priority Queue** – Serves elements based on importance, not arrival.
29+
30+
---
31+
32+
## 🧠 Applications
33+
- Process scheduling
34+
- Call center routing
35+
- IO buffering
36+
- Message queues
37+
38+
> ✨ “Queue teaches patience — whoever comes first gets served first.” ✨

0 commit comments

Comments
 (0)