C++ Full DSA RoadMap with helping code
🚀 1️⃣ LINKED LISTS
A. Singly Linked List
Node structure
Insert (head, tail, middle)
Delete (head, tail, middle)
Search
Reverse a linked list
Middle of list
Detect loop
Remove loop
Merge two sorted lists
Intersection of two lists
B. Doubly Linked List
Insert (head, tail)
Delete (head, tail)
Forward/backward traversal
C. Circular Linked List
Insert & delete
Traversal
Applications (round-robin, scheduling)
D. Slow & Fast Pointer Techniques
Find middle
Detect cycle
Find cycle length
Find start of cycle
📦 2️⃣ STACKS Concepts
Push, Pop, Top
Overflow / Underflow
Applications
Important Problems
Reverse string using stack
Balanced parentheses
Next greater element
Stock span
Min stack
Postfix evaluation
Infix → Postfix conversion
🔄 3️⃣ QUEUES Concepts
Simple Queue
Circular Queue
Deque
Priority Queue
Double-ended queue
Important Problems
First non-repeating character
Sliding window maximum
Implement stack using queues
Implement queue using stacks
🔍 4️⃣ HASHING Concepts
Hash table
Hash functions
Chaining
Linear / Quadratic probing
Maps & unordered maps
Important Problems
Frequency counting
Two-sum
Longest subarray with sum k
Count distinct elements
Subarray with zero sum
Group anagrams
✨ 5️⃣ STRINGS Basic Concepts
String manipulation
Frequency array
Palindrome checking
Substring vs Subsequence
Advanced Techniques
Sliding window
Two pointers
Hashing for strings
KMP Algorithm
Z Algorithm
Rabin-Karp
Important Problems
Longest substring without repeating characters
Longest common prefix
String rotation
Pattern matching
🧭 6️⃣ ARRAYS (Advanced Techniques) Patterns
Two pointers
Kadane’s algorithm
Prefix sum
Sliding window
Difference array
Searching (binary search)
Problems
Largest subarray sum
Rotate array
Max product subarray
Majority element
Search in sorted rotated array
🔁 7️⃣ RECURSION & BACKTRACKING Core Concepts
Base case + recursion tree
Subset generation
Permutations
Backtracking template
Key Problems
N-Queens
Rat in a maze
Subset sum
Phone keypad combinations
Palindrome partitioning
⚡ 8️⃣ SORTING & SEARCHING Sorting
Merge sort
Quick sort
Heap sort
Counting sort
Bucket / Radix sort
Binary Search Problems
First & last occurrence
Peak element
Aggressive cows
Shipping capacity
Allocate pages
🧲 9️⃣ GREEDY ALGORITHMS Core Concepts
Greedy choice property
Activity selection
Fractional knapsack
Huffman coding
Minimum platforms
🌳 🔟 TREES Tree Basics
Terminology (node, edge, height, depth)
Tree traversals:
Inorder
Preorder
Postorder
Level-order
Binary Search Tree (BST)
Insert
Search
Delete
Predecessor & successor
Balanced vs unbalanced trees
Tree Problems
Height of tree
Diameter of tree
Check balanced tree
Lowest common ancestor (LCA)
Boundary traversal
Zig-zag traversal
Vertical order
🏗️ 1️⃣1️⃣ BINARY HEAP & PRIORITY QUEUE Concepts
Min heap
Max heap
Heapify
Heapsort
Problems
K largest elements
Merge K sorted lists
Kth smallest/largest element