|
| 1 | +{ |
| 2 | + "title": "Data Structures & Algorithms Decision Tree", |
| 3 | + "description": "Follow the decision paths to choose the right approach", |
| 4 | + "sections": [ |
| 5 | + { |
| 6 | + "id": "arrays", |
| 7 | + "title": "Arrays", |
| 8 | + "color": "bg-blue-500", |
| 9 | + "content": [ |
| 10 | + { "type": "info", "text": "Dynamic vs Static Arrays" }, |
| 11 | + { "type": "question", "text": "Searching - Is it sorted?" }, |
| 12 | + { |
| 13 | + "type": "answer", |
| 14 | + "text": "Yes → Divide and Conquer - Binary Search O(log N)" |
| 15 | + }, |
| 16 | + { |
| 17 | + "type": "answer", |
| 18 | + "text": "No → Will sorting help? If not, Linear Search O(n)" |
| 19 | + }, |
| 20 | + { |
| 21 | + "type": "note", |
| 22 | + "text": "Fast access O(1), but O(n) on expanding memory" |
| 23 | + } |
| 24 | + ] |
| 25 | + }, |
| 26 | + { |
| 27 | + "id": "hash-tables", |
| 28 | + "title": "Hash Tables", |
| 29 | + "color": "bg-green-500", |
| 30 | + "content": [ |
| 31 | + { |
| 32 | + "type": "info", |
| 33 | + "text": "Fast Access O(1), tradeoff: more memory O(n)" |
| 34 | + }, |
| 35 | + { "type": "question", "text": "Need to improve time complexity?" }, |
| 36 | + { "type": "answer", "text": "Yes → Use Hash Table for O(1) lookups" }, |
| 37 | + { "type": "question", "text": "Collision handling?" }, |
| 38 | + { "type": "answer", "text": "Chaining with Linked Lists" }, |
| 39 | + { |
| 40 | + "type": "note", |
| 41 | + "text": "Could be O(n) with collisions and resizing (unlikely)" |
| 42 | + } |
| 43 | + ] |
| 44 | + }, |
| 45 | + { |
| 46 | + "id": "linked-lists", |
| 47 | + "title": "Linked Lists", |
| 48 | + "color": "bg-purple-500", |
| 49 | + "content": [ |
| 50 | + { "type": "info", "text": "Singly Linked List" }, |
| 51 | + { "type": "info", "text": "Doubly Linked List" }, |
| 52 | + { |
| 53 | + "type": "use", |
| 54 | + "text": "Good for: Stacks, Queues, collision handling" |
| 55 | + }, |
| 56 | + { |
| 57 | + "type": "note", |
| 58 | + "text": "O(n) for search, O(1) for insertion/deletion at known position" |
| 59 | + } |
| 60 | + ] |
| 61 | + }, |
| 62 | + { |
| 63 | + "id": "stacks-queues", |
| 64 | + "title": "Stacks & Queues", |
| 65 | + "color": "bg-yellow-500", |
| 66 | + "content": [ |
| 67 | + { |
| 68 | + "type": "info", |
| 69 | + "text": "Stack: LIFO - Array or Linked List implementation" |
| 70 | + }, |
| 71 | + { |
| 72 | + "type": "info", |
| 73 | + "text": "Queue: FIFO - Linked List implementation (Array is BAD)" |
| 74 | + }, |
| 75 | + { "type": "use", "text": "Stacks: DFS, function calls, undo/redo" }, |
| 76 | + { "type": "use", "text": "Queues: BFS, task scheduling" } |
| 77 | + ] |
| 78 | + }, |
| 79 | + { |
| 80 | + "id": "trees", |
| 81 | + "title": "Trees", |
| 82 | + "color": "bg-red-500", |
| 83 | + "content": [ |
| 84 | + { "type": "info", "text": "Binary Tree, Binary Search Tree (BST)" }, |
| 85 | + { "type": "info", "text": "Balanced BST: AVL Tree, Red-Black Tree" }, |
| 86 | + { "type": "question", "text": "Tree Traversal? O(n)" }, |
| 87 | + { "type": "answer", "text": "Inorder (left, root, right)" }, |
| 88 | + { "type": "answer", "text": "Preorder (root, left, right)" }, |
| 89 | + { "type": "answer", "text": "Postorder (left, right, root)" }, |
| 90 | + { "type": "info", "text": "Trie: For string/prefix problems" } |
| 91 | + ] |
| 92 | + }, |
| 93 | + { |
| 94 | + "id": "graphs", |
| 95 | + "title": "Graphs", |
| 96 | + "color": "bg-indigo-500", |
| 97 | + "content": [ |
| 98 | + { "type": "question", "text": "Graph Traversal? O(n)" }, |
| 99 | + { |
| 100 | + "type": "answer", |
| 101 | + "text": "DFS (Depth First Search) - Stack/Recursion" |
| 102 | + }, |
| 103 | + { "type": "answer", "text": "BFS (Breadth First Search) - Queue" }, |
| 104 | + { "type": "question", "text": "Shortest Path?" }, |
| 105 | + { "type": "answer", "text": "Unweighted → BFS" }, |
| 106 | + { "type": "answer", "text": "Weighted → Dijkstra or Bellman-Ford" }, |
| 107 | + { |
| 108 | + "type": "info", |
| 109 | + "text": "Consider: Directed/Undirected, Cyclic/Acyclic" |
| 110 | + } |
| 111 | + ] |
| 112 | + }, |
| 113 | + { |
| 114 | + "id": "heaps", |
| 115 | + "title": "Heaps & Priority Queues", |
| 116 | + "color": "bg-pink-500", |
| 117 | + "content": [ |
| 118 | + { "type": "info", "text": "Binary Heap (Min/Max Heap)" }, |
| 119 | + { "type": "info", "text": "Priority Queue implementation" }, |
| 120 | + { "type": "use", "text": "Finding K largest/smallest elements" }, |
| 121 | + { "type": "use", "text": "Median finding, scheduling problems" }, |
| 122 | + { "type": "note", "text": "Insert/Delete: O(log n), Get min/max: O(1)" } |
| 123 | + ] |
| 124 | + }, |
| 125 | + { |
| 126 | + "id": "sorting", |
| 127 | + "title": "Sorting Algorithms", |
| 128 | + "color": "bg-orange-500", |
| 129 | + "content": [ |
| 130 | + { |
| 131 | + "type": "info", |
| 132 | + "text": "O(N log N): Quick Sort, Merge Sort, Heap Sort" |
| 133 | + }, |
| 134 | + { |
| 135 | + "type": "info", |
| 136 | + "text": "O(n²): Bubble Sort, Insertion Sort, Selection Sort" |
| 137 | + }, |
| 138 | + { |
| 139 | + "type": "info", |
| 140 | + "text": "O(n): Counting Sort, Radix Sort (special cases)" |
| 141 | + }, |
| 142 | + { "type": "question", "text": "When to sort?" }, |
| 143 | + { |
| 144 | + "type": "answer", |
| 145 | + "text": "If sorted data makes problem easier (binary search, etc.)" |
| 146 | + } |
| 147 | + ] |
| 148 | + }, |
| 149 | + { |
| 150 | + "id": "dp", |
| 151 | + "title": "Dynamic Programming", |
| 152 | + "color": "bg-teal-500", |
| 153 | + "content": [ |
| 154 | + { "type": "info", "text": "Memoization (Top-Down)" }, |
| 155 | + { "type": "info", "text": "Tabulation (Bottom-Up)" }, |
| 156 | + { "type": "question", "text": "Can you use recursion?" }, |
| 157 | + { "type": "answer", "text": "Yes → Consider DP with memoization" }, |
| 158 | + { |
| 159 | + "type": "note", |
| 160 | + "text": "⚠️ Be mindful of Space Complexity (Stack overflow)" |
| 161 | + }, |
| 162 | + { |
| 163 | + "type": "use", |
| 164 | + "text": "Optimal substructure + overlapping subproblems" |
| 165 | + } |
| 166 | + ] |
| 167 | + }, |
| 168 | + { |
| 169 | + "id": "strings", |
| 170 | + "title": "String Problems", |
| 171 | + "color": "bg-cyan-500", |
| 172 | + "content": [ |
| 173 | + { "type": "question", "text": "String question?" }, |
| 174 | + { "type": "answer", "text": "Turn it into an Array ~ split()" }, |
| 175 | + { |
| 176 | + "type": "answer", |
| 177 | + "text": "Consider using Hash Table for character frequency" |
| 178 | + }, |
| 179 | + { "type": "answer", "text": "Trie for prefix/suffix problems" }, |
| 180 | + { "type": "use", "text": "Sliding window for substrings" } |
| 181 | + ] |
| 182 | + } |
| 183 | + ] |
| 184 | +} |
0 commit comments