==> Data Structures => Linear . Array . Strings . Linked List . Stack . Queue . Deque . Hash Table / Hash Map
=> Non-Linear . Trees . Binary Search Tree (BST) . Heaps / Priority Queue . Segment Tree / Fenwick Tree (BIT) . Graphs . Tries . Union Find (Disjoint Set)
==> Algorithms . Linear Search . Basic Sorting (Bubble, Selection, Insertion) . Merge Sort / Quick Sort . Cyclic Sort . Binary Search . Modified Binary Search . Bit Manipulation . Tree Traversals . Graph Traversals . Topological Sort . Shortest Path (Dijkstra / Bellman-Ford / Floyd-Warshall) . Minimum Spanning Tree (Kruskal's / Prim's)
==> Patterns . Two Pointers . Fast & Slow Pointers . Sliding Window . Prefix Sum . Intervals . Cyclic Sort ← borderline pattern/algorithm, fits both . Matrix Traversal . Monotonic Stack/Queue . Divide & Conquer . Greedy . Recursion . Backtracking . Top K Elements (Heap) . K-way Merge . Dynamic Programming
==========================================================
====> order of learning => Phase 1: Basic Linear Structures & Their Patterns . Time & Space Complexity (Big-O) . array . strings . Recursion (pattern) [base case, recursive case, call stack visualization] . searching (Algorithm) [Linear Search] . Basic Sorting (Bubble, Selection, Insertion) . two pointers (pattern) . binary search (algorithm) . Modified Binary Search . sliding window (pattern) . Cyclic Sort . prefix sum (pattern) [(1D and 2D)] . Intervals (Pattern) . Matrix Traversal (Pattern) [indexing, 2D prefix sum]
=> Phase 2: The Power of Lookup (Hashing) . hash table /hash map . Greedy (Pattern)
=> Phase 3: Pointers & Recursion . linked list . Recursion (pattern) [multiple recursive calls, memoization prep, linked list recursion] . sorting (Merge sort, Quick sort) . Divide and Conquer (Pattern) . stack . queue . Deque (Double-ended Queue) . Monotonic Stack/Queue (pattern) . fast and slow pointers (pattern)
=> Phase 4: Non-Linear Structures (Hierarchical) . Trees and properties (height, depth, diameter) . binary trees . Tree Traversals (Algorithm) [(preorder, inorder, postorder, level-order)] . Binary Search Tree (BST) . Heaps / Priority Queue . Segment Tree / Fenwick Tree (BIT) . Top K Elements (Pattern) . K-way Merge
=> Phase 5: Advanced Search & Backtracking . Backtracking (Pattern) . Tries
=> Phase 6: Connectivity (Graphs) . Graphs and Graph representations (Adjacency List / Matrix) . Matrix Traversal (Pattern) [(DFS/BFS on grids)] . Graph Traversals (Algorithm) . Topological Sort . Union Find (Disjoint Set) . Shortest Path (Algorithm) (Dijkstra / Bellman-Ford / Floyd-Warshall) . Minimum Spanning Tree (Kruskal's / Prim's)
=> Phase 7: Optimization (The Hardest Part) . Bit Manipulation (algorithm) . Dynamic Programming (pattern) [Recursion → Memoization. Tabulation. Space Optimization]