╔══════════════════════════════════════════════════════════════╗
║ STACK (LIFO - Last In First Out) ║
╚══════════════════════════════════════════════════════════════╝
PUSH Operations: POP Operations:
───────────────── ──────────────
Step 1: Push(5) Step 1: Pop()
┌─────┐ ┌─────┐
│ │ │ │
│ │ │ 5 │ ← Removed
│ │ └─────┘
│ 5 │ ← Top ↓
└─────┘ ┌─────┐
│ │
Step 2: Push(10) │ │
┌─────┐ │ │
│ │ │ │
│ 10 │ ← Top └─────┘
│ 5 │
└─────┘
Step 3: Push(15)
┌─────┐
│ 15 │ ← Top
│ 10 │
│ 5 │
└─────┘
Real-world Examples:
📚 Stack of plates
↩️ Browser back button
⏮️ Undo/Redo operations
╔══════════════════════════════════════════════════════════════╗
║ QUEUE (FIFO - First In First Out) ║
╚══════════════════════════════════════════════════════════════╝
ENQUEUE Operations:
──────────────────
Step 1: Enqueue(A)
Front Rear
↓ ↓
┌───┐
│ A │
└───┘
Step 2: Enqueue(B)
Front Rear
↓ ↓
┌───┬───┐
│ A │ B │
└───┴───┘
Step 3: Enqueue(C)
Front Rear
↓ ↓
┌───┬───┬───┐
│ A │ B │ C │
└───┴───┴───┘
DEQUEUE Operations:
──────────────────
Step 1: Dequeue() → Returns 'A'
Front Rear
↓ ↓
┌───┬───┐
│ B │ C │
└───┴───┘
Real-world Examples:
🎫 Print queue
👥 Customer service line
📞 Call center routing
╔══════════════════════════════════════════════════════════════╗
║ SINGLY LINKED LIST ║
╚══════════════════════════════════════════════════════════════╝
Structure:
─────────
HEAD
↓
┌──────┬────┐ ┌──────┬────┐ ┌──────┬────┐
│ Data │Next├───→│ Data │Next├───→│ Data │NULL│
│ 10 │ ●─┘ │ 20 │ ●─┘ │ 30 │ │
└──────┴────┘ └──────┴────┘ └──────┴────┘
Node 1 Node 2 Node 3
Insert at Beginning:
───────────────────
NEW NODE HEAD
↓ ↓
┌──────┬────┐ ┌──────┬────┐ ┌──────┬────┐ ┌──────┬────┐
│ Data │Next├───→│ Data │Next├───→│ Data │Next├───→│ Data │NULL│
│ 5 │ ●─┘ │ 10 │ ●─┘ │ 20 │ ●─┘ │ 30 │ │
└──────┴────┘ └──────┴────┘ └──────┴────┘ └──────┴────┘
Advantages:
✅ Dynamic size
✅ Efficient insertion/deletion
✅ No memory waste
Disadvantages:
❌ No random access
❌ Extra memory for pointers
❌ Not cache friendly
╔══════════════════════════════════════════════════════════════╗
║ BREADTH-FIRST SEARCH (BFS) - Level Order ║
╚══════════════════════════════════════════════════════════════╝
Graph Structure:
───────────────
1
/ | \
/ | \
2 3 4
/ \ |
5 6 7
BFS Traversal Process:
─────────────────────
Level 0: [1] Queue: [1]
Visit: 1
Level 1: [2, 3, 4] Queue: [2, 3, 4]
Visit: 2, 3, 4
Level 2: [5, 6, 7] Queue: [5, 6, 7]
Visit: 5, 6, 7
BFS Order: 1 → 2 → 3 → 4 → 5 → 6 → 7
Time Complexity: O(V + E)
Space Complexity: O(V)
╔══════════════════════════════════════════════════════════════╗
║ DEPTH-FIRST SEARCH (DFS) - Deep Dive ║
╚══════════════════════════════════════════════════════════════╝
Graph Structure:
───────────────
1
/ | \
/ | \
2 3 4
/ \ |
5 6 7
DFS Traversal Process (Recursive):
──────────────────────────────────
Step 1: Start at 1
Stack: [1]
Visit: 1
Step 2: Go to leftmost child (2)
Stack: [1, 2]
Visit: 2
Step 3: Go to leftmost child of 2 (5)
Stack: [1, 2, 5]
Visit: 5
Step 4: Backtrack to 2, visit 6
Stack: [1, 2, 6]
Visit: 6
Step 5: Backtrack to 1, visit 3
Stack: [1, 3]
Visit: 3
Step 6: Backtrack to 1, visit 4
Stack: [1, 4]
Visit: 4
Step 7: Visit 7
Stack: [1, 4, 7]
Visit: 7
DFS Order: 1 → 2 → 5 → 6 → 3 → 4 → 7
Time Complexity: O(V + E)
Space Complexity: O(V)
- GitHub Social Preview: 1280 x 640 px
- Header Banner: 1200 x 300 px
- Profile Banner: 1584 x 396 px
┌─────────────────────────────────────────────────────────────┐
│ │
│ 🧠 C++ Data Structures & Algorithms │
│ │
│ [Stack Icon] [Queue Icon] [List Icon] [Graph Icon] │
│ │
│ Master DSA • Interview Prep • Hands-On Learning │
│ │
└─────────────────────────────────────────────────────────────┘
Professional Tech Theme:
- Primary: #0366d6 (GitHub Blue)
- Secondary: #28a745 (Success Green)
- Accent: #6f42c1 (Purple)
- Background: #f6f8fa (Light Gray)
- Text: #24292e (Dark Gray)
Modern Dark Theme:
- Primary: #58a6ff (Bright Blue)
- Secondary: #3fb950 (Green)
- Accent: #f85149 (Red)
- Background: #0d1117 (Dark)
- Text: #c9d1d9 (Light Gray)
┌────────────────┬──────────┬──────────┬──────────┬──────────┐
│ Operation │ Array │ Stack │ Queue │ List │
├────────────────┼──────────┼──────────┼──────────┼──────────┤
│ Access │ O(1) │ O(n) │ O(n) │ O(n) │
│ Search │ O(n) │ O(n) │ O(n) │ O(n) │
│ Insert (End) │ O(1) │ O(1) │ O(1) │ O(1) │
│ Insert (Start) │ O(n) │ N/A │ N/A │ O(1) │
│ Delete (End) │ O(1) │ O(1) │ N/A │ O(n) │
│ Delete (Start) │ O(n) │ N/A │ O(1) │ O(1) │
└────────────────┴──────────┴──────────┴──────────┴──────────┘
Use tools like:
- Carbon (carbon.now.sh) - Beautiful code screenshots
- Terminalizer - Animated terminal recordings
- Asciinema - Terminal session recorder
// ═══════════════════════════════════════════════════════════
// 📚 STACK IMPLEMENTATION - PUSH OPERATION
// ═══════════════════════════════════════════════════════════
void push(int stack[], int &top, int max, int value) {
if (top >= max - 1) {
cout << "❌ Stack Overflow!" << endl;
return;
}
stack[++top] = value;
cout << "✅ Pushed: " << value << endl;
}-
Stack Operations
- Show push/pop animations
- Highlight LIFO behavior
-
Queue Operations
- Show enqueue/dequeue
- Demonstrate FIFO concept
-
BFS Traversal
- Animate level-by-level exploration
- Show queue state
-
DFS Traversal
- Animate depth-first exploration
- Show stack state
- Manim (Python library)
- Vizualization.algo (Online)
- LICEcap (Screen recorder)
- ScreenToGif (Windows)
┌─────────────────────────────────────┐
│ 🎯 New GitHub Project! │
│ │
│ C++ Data Structures & Algorithms │
│ │
│ ✅ Stack & Queue │
│ ✅ Linked Lists │
│ ✅ Graph Algorithms │
│ ✅ Interview Ready │
│ │
│ [GitHub Link] │
│ │
│ #CPlusPlus #DSA #Coding │
└─────────────────────────────────────┘
┌─────────────────────────────────────────────────────────────┐
│ │
│ 🏆 Achievements │
│ │
│ ⭐ 50+ Stars 🍴 20+ Forks 👁️ 1000+ Views │
│ │
│ 🎯 Interview Ready 📚 Well Documented ✅ Tested │
│ │
└─────────────────────────────────────────────────────────────┘
START
│
▼
┌─────────────┐
│ Initialize │
└──────┬──────┘
│
▼
┌─────────────┐ NO
│ Condition? ├──────────┐
└──────┬──────┘ │
│ YES │
▼ ▼
┌─────────────┐ ┌─────────────┐
│ Process A │ │ Process B │
└──────┬──────┘ └──────┬──────┘
│ │
└────────┬────────┘
▼
END
- Use Emojis Strategically - Adds visual interest, but don't overdo it
- Consistent Formatting - Stick to one style throughout
- White Space - Don't crowd information
- Visual Hierarchy - Use headers, sizes, and colors effectively
- Mobile-Friendly - Test on different screen sizes
- Canva - Banner/graphics creation
- Figma - Professional design tool
- Excalidraw - Simple diagrams
- Draw.io - Flowcharts
- Carbon - Beautiful code images
- Ray.so - Code screenshots
- CodeSnap - VS Code extension
- Font Awesome - Icon library
- Devicons - Developer icons
- Simple Icons - Brand icons