mirror of
https://github.com/prdlk/leetcode.git
synced 2026-09-17 07:26:27 +00:00
docs(docs): replace markdown tables with HTML, add binary search concept page, and clean two‑pointers guide
This commit is contained in:
@@ -10,278 +10,338 @@
|
||||
|
||||
## Phase I — Linear Structures (Week 1)
|
||||
|
||||
### 1. Hash-Based Lookup — builds on nothing
|
||||
| Set | LC # | Problem |
|
||||
|---|---|---|
|
||||
| A | 217 | Contains Duplicate |
|
||||
| A | 242 | Valid Anagram |
|
||||
| A | 1 | Two Sum |
|
||||
| A | 49 | Group Anagrams |
|
||||
| A | 347 | Top K Frequent Elements |
|
||||
| B | 383 | Ransom Note |
|
||||
| B | 205 | Isomorphic Strings |
|
||||
| B | 128 | Longest Consecutive Sequence |
|
||||
| B | 290 | Word Pattern |
|
||||
|
||||
### 2. Prefix Sum — builds on 1
|
||||
| Set | LC # | Problem |
|
||||
|---|---|---|
|
||||
| A | 303 | Range Sum Query |
|
||||
| A | 238 | Product of Array Except Self |
|
||||
| A | 560 | Subarray Sum Equals K |
|
||||
| B | 525 | Contiguous Array |
|
||||
| B | 974 | Subarray Sums Divisible by K |
|
||||
|
||||
### 3. Two Pointers — builds on ordered iteration
|
||||
| Set | LC # | Problem |
|
||||
|---|---|---|
|
||||
| A | 125 | Valid Palindrome |
|
||||
| A | 167 | Two Sum II |
|
||||
| A | 15 | 3Sum |
|
||||
| A | 11 | Container With Most Water |
|
||||
| A | 42 | Trapping Rain Water |
|
||||
| B | 392 | Is Subsequence |
|
||||
| B | 977 | Squares of a Sorted Array |
|
||||
| B | 189 | Rotate Array |
|
||||
| B | 80 | Remove Duplicates II |
|
||||
|
||||
### 4. Sliding Window — builds on 3
|
||||
| Set | LC # | Problem |
|
||||
|---|---|---|
|
||||
| A | 121 | Best Time to Buy and Sell Stock |
|
||||
| A | 3 | Longest Substring Without Repeating Characters |
|
||||
| A | 424 | Longest Repeating Character Replacement |
|
||||
| A | 567 | Permutation in String |
|
||||
| A | 76 | Minimum Window Substring |
|
||||
| B | 209 | Minimum Size Subarray Sum |
|
||||
| B | 1004 | Max Consecutive Ones III |
|
||||
| B | 643 | Maximum Average Subarray |
|
||||
|
||||
### 5. Binary Search — builds on ordered/monotonic invariants
|
||||
| Set | LC # | Problem |
|
||||
|---|---|---|
|
||||
| A | 704 | Binary Search |
|
||||
| A | 74 | Search a 2D Matrix |
|
||||
| A | 875 | Koko Eating Bananas |
|
||||
| A | 33 | Search in Rotated Sorted Array |
|
||||
| A | 153 | Find Minimum in Rotated Sorted Array |
|
||||
| B | 35 | Search Insert Position |
|
||||
| B | 162 | Find Peak Element |
|
||||
| B | 34 | First & Last Position |
|
||||
| B ⭐ | 4 | Median of Two Sorted Arrays |
|
||||
|
||||
### 6. Stack — independent primitive
|
||||
| Set | LC # | Problem |
|
||||
|---|---|---|
|
||||
| A | 20 | Valid Parentheses |
|
||||
| A | 155 | Min Stack |
|
||||
| A | 150 | Evaluate Reverse Polish Notation |
|
||||
| B | 71 | Simplify Path |
|
||||
| B ⭐ | 224 | Basic Calculator |
|
||||
|
||||
### 7. Monotonic Stack — builds on 6
|
||||
| Set | LC # | Problem |
|
||||
|---|---|---|
|
||||
| A | 739 | Daily Temperatures |
|
||||
| A | 853 | Car Fleet |
|
||||
| B | 496 | Next Greater Element I |
|
||||
| B | 901 | Online Stock Span |
|
||||
| B ⭐ | 84 | Largest Rectangle in Histogram |
|
||||
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th align="left">Topic</th>
|
||||
<th align="center">Set</th>
|
||||
<th align="center">LC #</th>
|
||||
<th align="left">Problem</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td rowspan="9"><strong>1. Hash-Based Lookup</strong><br><sub>builds on nothing</sub></td>
|
||||
<td align="center"><code>A</code></td><td align="center">217</td><td><a href="https://leetcode.com/problems/contains-duplicate/">Contains Duplicate</a></td>
|
||||
</tr>
|
||||
<tr><td align="center"><code>A</code></td><td align="center">242</td><td><a href="https://leetcode.com/problems/valid-anagram/">Valid Anagram</a></td></tr>
|
||||
<tr><td align="center"><code>A</code></td><td align="center">1</td><td><a href="https://leetcode.com/problems/two-sum/">Two Sum</a></td></tr>
|
||||
<tr><td align="center"><code>A</code></td><td align="center">49</td><td><a href="https://leetcode.com/problems/group-anagrams/">Group Anagrams</a></td></tr>
|
||||
<tr><td align="center"><code>A</code></td><td align="center">347</td><td><a href="https://leetcode.com/problems/top-k-frequent-elements/">Top K Frequent Elements</a></td></tr>
|
||||
<tr><td align="center"><code>B</code></td><td align="center">383</td><td><a href="https://leetcode.com/problems/ransom-note/">Ransom Note</a></td></tr>
|
||||
<tr><td align="center"><code>B</code></td><td align="center">205</td><td><a href="https://leetcode.com/problems/isomorphic-strings/">Isomorphic Strings</a></td></tr>
|
||||
<tr><td align="center"><code>B</code></td><td align="center">128</td><td><a href="https://leetcode.com/problems/longest-consecutive-sequence/">Longest Consecutive Sequence</a></td></tr>
|
||||
<tr><td align="center"><code>B</code></td><td align="center">290</td><td><a href="https://leetcode.com/problems/word-pattern/">Word Pattern</a></td></tr>
|
||||
<tr>
|
||||
<td rowspan="5"><strong>2. Prefix Sum</strong><br><sub>builds on 1</sub></td>
|
||||
<td align="center"><code>A</code></td><td align="center">303</td><td><a href="https://leetcode.com/problems/range-sum-query-immutable/">Range Sum Query</a></td>
|
||||
</tr>
|
||||
<tr><td align="center"><code>A</code></td><td align="center">238</td><td><a href="https://leetcode.com/problems/product-of-array-except-self/">Product of Array Except Self</a></td></tr>
|
||||
<tr><td align="center"><code>A</code></td><td align="center">560</td><td><a href="https://leetcode.com/problems/subarray-sum-equals-k/">Subarray Sum Equals K</a></td></tr>
|
||||
<tr><td align="center"><code>B</code></td><td align="center">525</td><td><a href="https://leetcode.com/problems/contiguous-array/">Contiguous Array</a></td></tr>
|
||||
<tr><td align="center"><code>B</code></td><td align="center">974</td><td><a href="https://leetcode.com/problems/subarray-sums-divisible-by-k/">Subarray Sums Divisible by K</a></td></tr>
|
||||
<tr>
|
||||
<td rowspan="9"><strong>3. Two Pointers</strong><br><sub>builds on ordered iteration</sub></td>
|
||||
<td align="center"><code>A</code></td><td align="center">125</td><td><a href="https://leetcode.com/problems/valid-palindrome/">Valid Palindrome</a></td>
|
||||
</tr>
|
||||
<tr><td align="center"><code>A</code></td><td align="center">167</td><td><a href="https://leetcode.com/problems/two-sum-ii-input-array-is-sorted/">Two Sum II</a></td></tr>
|
||||
<tr><td align="center"><code>A</code></td><td align="center">15</td><td><a href="https://leetcode.com/problems/3sum/">3Sum</a></td></tr>
|
||||
<tr><td align="center"><code>A</code></td><td align="center">11</td><td><a href="https://leetcode.com/problems/container-with-most-water/">Container With Most Water</a></td></tr>
|
||||
<tr><td align="center"><code>A</code></td><td align="center">42</td><td><a href="https://leetcode.com/problems/trapping-rain-water/">Trapping Rain Water</a></td></tr>
|
||||
<tr><td align="center"><code>B</code></td><td align="center">392</td><td><a href="https://leetcode.com/problems/is-subsequence/">Is Subsequence</a></td></tr>
|
||||
<tr><td align="center"><code>B</code></td><td align="center">977</td><td><a href="https://leetcode.com/problems/squares-of-a-sorted-array/">Squares of a Sorted Array</a></td></tr>
|
||||
<tr><td align="center"><code>B</code></td><td align="center">189</td><td><a href="https://leetcode.com/problems/rotate-array/">Rotate Array</a></td></tr>
|
||||
<tr><td align="center"><code>B</code></td><td align="center">80</td><td><a href="https://leetcode.com/problems/remove-duplicates-from-sorted-array-ii/">Remove Duplicates II</a></td></tr>
|
||||
<tr>
|
||||
<td rowspan="8"><strong>4. Sliding Window</strong><br><sub>builds on 3</sub></td>
|
||||
<td align="center"><code>A</code></td><td align="center">121</td><td><a href="https://leetcode.com/problems/best-time-to-buy-and-sell-stock/">Best Time to Buy and Sell Stock</a></td>
|
||||
</tr>
|
||||
<tr><td align="center"><code>A</code></td><td align="center">3</td><td><a href="https://leetcode.com/problems/longest-substring-without-repeating-characters/">Longest Substring Without Repeating Characters</a></td></tr>
|
||||
<tr><td align="center"><code>A</code></td><td align="center">424</td><td><a href="https://leetcode.com/problems/longest-repeating-character-replacement/">Longest Repeating Character Replacement</a></td></tr>
|
||||
<tr><td align="center"><code>A</code></td><td align="center">567</td><td><a href="https://leetcode.com/problems/permutation-in-string/">Permutation in String</a></td></tr>
|
||||
<tr><td align="center"><code>A</code></td><td align="center">76</td><td><a href="https://leetcode.com/problems/minimum-window-substring/">Minimum Window Substring</a></td></tr>
|
||||
<tr><td align="center"><code>B</code></td><td align="center">209</td><td><a href="https://leetcode.com/problems/minimum-size-subarray-sum/">Minimum Size Subarray Sum</a></td></tr>
|
||||
<tr><td align="center"><code>B</code></td><td align="center">1004</td><td><a href="https://leetcode.com/problems/max-consecutive-ones-iii/">Max Consecutive Ones III</a></td></tr>
|
||||
<tr><td align="center"><code>B</code></td><td align="center">643</td><td><a href="https://leetcode.com/problems/maximum-average-subarray-i/">Maximum Average Subarray</a></td></tr>
|
||||
<tr>
|
||||
<td rowspan="9"><strong>5. Binary Search</strong><br><sub>builds on ordered / monotonic invariants</sub></td>
|
||||
<td align="center"><code>A</code></td><td align="center">704</td><td><a href="https://leetcode.com/problems/binary-search/">Binary Search</a></td>
|
||||
</tr>
|
||||
<tr><td align="center"><code>A</code></td><td align="center">74</td><td><a href="https://leetcode.com/problems/search-a-2d-matrix/">Search a 2D Matrix</a></td></tr>
|
||||
<tr><td align="center"><code>A</code></td><td align="center">875</td><td><a href="https://leetcode.com/problems/koko-eating-bananas/">Koko Eating Bananas</a></td></tr>
|
||||
<tr><td align="center"><code>A</code></td><td align="center">33</td><td><a href="https://leetcode.com/problems/search-in-rotated-sorted-array/">Search in Rotated Sorted Array</a></td></tr>
|
||||
<tr><td align="center"><code>A</code></td><td align="center">153</td><td><a href="https://leetcode.com/problems/find-minimum-in-rotated-sorted-array/">Find Minimum in Rotated Sorted Array</a></td></tr>
|
||||
<tr><td align="center"><code>B</code></td><td align="center">35</td><td><a href="https://leetcode.com/problems/search-insert-position/">Search Insert Position</a></td></tr>
|
||||
<tr><td align="center"><code>B</code></td><td align="center">162</td><td><a href="https://leetcode.com/problems/find-peak-element/">Find Peak Element</a></td></tr>
|
||||
<tr><td align="center"><code>B</code></td><td align="center">34</td><td><a href="https://leetcode.com/problems/find-first-and-last-position-of-element-in-sorted-array/">First & Last Position</a></td></tr>
|
||||
<tr><td align="center"><code>B</code> ⭐</td><td align="center">4</td><td><a href="https://leetcode.com/problems/median-of-two-sorted-arrays/">Median of Two Sorted Arrays</a></td></tr>
|
||||
<tr>
|
||||
<td rowspan="5"><strong>6. Stack</strong><br><sub>independent primitive</sub></td>
|
||||
<td align="center"><code>A</code></td><td align="center">20</td><td><a href="https://leetcode.com/problems/valid-parentheses/">Valid Parentheses</a></td>
|
||||
</tr>
|
||||
<tr><td align="center"><code>A</code></td><td align="center">155</td><td><a href="https://leetcode.com/problems/min-stack/">Min Stack</a></td></tr>
|
||||
<tr><td align="center"><code>A</code></td><td align="center">150</td><td><a href="https://leetcode.com/problems/evaluate-reverse-polish-notation/">Evaluate Reverse Polish Notation</a></td></tr>
|
||||
<tr><td align="center"><code>B</code></td><td align="center">71</td><td><a href="https://leetcode.com/problems/simplify-path/">Simplify Path</a></td></tr>
|
||||
<tr><td align="center"><code>B</code> ⭐</td><td align="center">224</td><td><a href="https://leetcode.com/problems/basic-calculator/">Basic Calculator</a></td></tr>
|
||||
<tr>
|
||||
<td rowspan="5"><strong>7. Monotonic Stack</strong><br><sub>builds on 6</sub></td>
|
||||
<td align="center"><code>A</code></td><td align="center">739</td><td><a href="https://leetcode.com/problems/daily-temperatures/">Daily Temperatures</a></td>
|
||||
</tr>
|
||||
<tr><td align="center"><code>A</code></td><td align="center">853</td><td><a href="https://leetcode.com/problems/car-fleet/">Car Fleet</a></td></tr>
|
||||
<tr><td align="center"><code>B</code></td><td align="center">496</td><td><a href="https://leetcode.com/problems/next-greater-element-i/">Next Greater Element I</a></td></tr>
|
||||
<tr><td align="center"><code>B</code></td><td align="center">901</td><td><a href="https://leetcode.com/problems/online-stock-span/">Online Stock Span</a></td></tr>
|
||||
<tr><td align="center"><code>B</code> ⭐</td><td align="center">84</td><td><a href="https://leetcode.com/problems/largest-rectangle-in-histogram/">Largest Rectangle in Histogram</a></td></tr>
|
||||
</tbody>
|
||||
</table>
|
||||
---
|
||||
|
||||
## Phase II — Nodal & Grid Structures (Week 2)
|
||||
|
||||
### 8. Linked List — independent primitive
|
||||
| Set | LC # | Problem |
|
||||
|---|---|---|
|
||||
| A | 206 | Reverse Linked List |
|
||||
| A | 21 | Merge Two Sorted Lists |
|
||||
| A | 141 | Linked List Cycle |
|
||||
| A | 19 | Remove Nth Node From End |
|
||||
| A | 143 | Reorder List |
|
||||
| B | 876 | Middle of the Linked List |
|
||||
| B | 92 | Reverse Linked List II |
|
||||
| B | 82 | Remove Duplicates from Sorted List II |
|
||||
| B | 61 | Rotate List |
|
||||
| B | 86 | Partition List |
|
||||
|
||||
### 9. Hybrid Structures — builds on 1 + 8
|
||||
| Set | LC # | Problem |
|
||||
|---|---|---|
|
||||
| A | 146 | LRU Cache |
|
||||
| A | 2 | Add Two Numbers |
|
||||
| B | 138 | Copy List with Random Pointer |
|
||||
| B | 380 | Insert Delete GetRandom O(1) |
|
||||
|
||||
### 10. Matrix Index Math — builds on 3
|
||||
| Set | LC # | Problem |
|
||||
|---|---|---|
|
||||
| A | 48 | Rotate Image |
|
||||
| A | 54 | Spiral Matrix |
|
||||
| A | 73 | Set Matrix Zeroes |
|
||||
| B | 36 | Valid Sudoku |
|
||||
| B | 289 | Game of Life |
|
||||
## Phase II — Nodal & Grid Structures (Week 2)
|
||||
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th align="left">Topic</th>
|
||||
<th align="center">Set</th>
|
||||
<th align="center">LC #</th>
|
||||
<th align="left">Problem</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td rowspan="10"><strong>8. Linked List</strong><br><sub>independent primitive</sub></td>
|
||||
<td align="center"><code>A</code></td><td align="center">206</td><td><a href="https://leetcode.com/problems/reverse-linked-list/">Reverse Linked List</a></td>
|
||||
</tr>
|
||||
<tr><td align="center"><code>A</code></td><td align="center">21</td><td><a href="https://leetcode.com/problems/merge-two-sorted-lists/">Merge Two Sorted Lists</a></td></tr>
|
||||
<tr><td align="center"><code>A</code></td><td align="center">141</td><td><a href="https://leetcode.com/problems/linked-list-cycle/">Linked List Cycle</a></td></tr>
|
||||
<tr><td align="center"><code>A</code></td><td align="center">19</td><td><a href="https://leetcode.com/problems/remove-nth-node-from-end-of-list/">Remove Nth Node From End</a></td></tr>
|
||||
<tr><td align="center"><code>A</code></td><td align="center">143</td><td><a href="https://leetcode.com/problems/reorder-list/">Reorder List</a></td></tr>
|
||||
<tr><td align="center"><code>B</code></td><td align="center">876</td><td><a href="https://leetcode.com/problems/middle-of-the-linked-list/">Middle of the Linked List</a></td></tr>
|
||||
<tr><td align="center"><code>B</code></td><td align="center">92</td><td><a href="https://leetcode.com/problems/reverse-linked-list-ii/">Reverse Linked List II</a></td></tr>
|
||||
<tr><td align="center"><code>B</code></td><td align="center">82</td><td><a href="https://leetcode.com/problems/remove-duplicates-from-sorted-list-ii/">Remove Duplicates from Sorted List II</a></td></tr>
|
||||
<tr><td align="center"><code>B</code></td><td align="center">61</td><td><a href="https://leetcode.com/problems/rotate-list/">Rotate List</a></td></tr>
|
||||
<tr><td align="center"><code>B</code></td><td align="center">86</td><td><a href="https://leetcode.com/problems/partition-list/">Partition List</a></td></tr>
|
||||
<tr>
|
||||
<td rowspan="4"><strong>9. Hybrid Structures</strong><br><sub>builds on 1 + 8</sub></td>
|
||||
<td align="center"><code>A</code></td><td align="center">146</td><td><a href="https://leetcode.com/problems/lru-cache/">LRU Cache</a></td>
|
||||
</tr>
|
||||
<tr><td align="center"><code>A</code></td><td align="center">2</td><td><a href="https://leetcode.com/problems/add-two-numbers/">Add Two Numbers</a></td></tr>
|
||||
<tr><td align="center"><code>B</code></td><td align="center">138</td><td><a href="https://leetcode.com/problems/copy-list-with-random-pointer/">Copy List with Random Pointer</a></td></tr>
|
||||
<tr><td align="center"><code>B</code></td><td align="center">380</td><td><a href="https://leetcode.com/problems/insert-delete-getrandom-o1/">Insert Delete GetRandom O(1)</a></td></tr>
|
||||
<tr>
|
||||
<td rowspan="5"><strong>10. Matrix Index Math</strong><br><sub>builds on 3 — NOT graph traversal</sub></td>
|
||||
<td align="center"><code>A</code></td><td align="center">48</td><td><a href="https://leetcode.com/problems/rotate-image/">Rotate Image</a></td>
|
||||
</tr>
|
||||
<tr><td align="center"><code>A</code></td><td align="center">54</td><td><a href="https://leetcode.com/problems/spiral-matrix/">Spiral Matrix</a></td></tr>
|
||||
<tr><td align="center"><code>A</code></td><td align="center">73</td><td><a href="https://leetcode.com/problems/set-matrix-zeroes/">Set Matrix Zeroes</a></td></tr>
|
||||
<tr><td align="center"><code>B</code></td><td align="center">36</td><td><a href="https://leetcode.com/problems/valid-sudoku/">Valid Sudoku</a></td></tr>
|
||||
<tr><td align="center"><code>B</code></td><td align="center">289</td><td><a href="https://leetcode.com/problems/game-of-life/">Game of Life</a></td></tr>
|
||||
</tbody>
|
||||
</table>
|
||||
---
|
||||
|
||||
## Phase III — Hierarchical Structures (Week 3)
|
||||
|
||||
### 11. Tree DFS — builds on recursion
|
||||
| Set | LC # | Problem |
|
||||
|---|---|---|
|
||||
| A | 226 | Invert Binary Tree |
|
||||
| A | 104 | Maximum Depth of Binary Tree |
|
||||
| A | 100 | Same Tree |
|
||||
| A | 572 | Subtree of Another Tree |
|
||||
| A | 236 | Lowest Common Ancestor |
|
||||
| A ⭐ | 124 | Binary Tree Maximum Path Sum |
|
||||
| B | 101 | Symmetric Tree |
|
||||
| B | 112 | Path Sum |
|
||||
| B | 129 | Sum Root to Leaf Numbers |
|
||||
| B | 543 | Diameter of Binary Tree |
|
||||
|
||||
### 12. Tree BFS — builds on 6's sibling (queue) + 11
|
||||
| Set | LC # | Problem |
|
||||
|---|---|---|
|
||||
| A | 102 | Level Order Traversal |
|
||||
| A | 199 | Right Side View |
|
||||
| A | 1448 | Count Good Nodes |
|
||||
| B | 103 | Zigzag Level Order |
|
||||
| B | 637 | Average of Levels |
|
||||
|
||||
### 13. Binary Search Tree — builds on 5 + 11
|
||||
| Set | LC # | Problem |
|
||||
|---|---|---|
|
||||
| A | 98 | Validate BST |
|
||||
| A | 230 | Kth Smallest in BST |
|
||||
| A | 235 | LCA of BST |
|
||||
| A | 105 | Build from Preorder + Inorder |
|
||||
| B | 530 | Minimum Absolute Difference |
|
||||
| B | 173 | BST Iterator |
|
||||
| B | 108 | Sorted Array to BST |
|
||||
|
||||
### 14. Heap / Priority Queue — builds on trees (implicit tree over array)
|
||||
| Set | LC # | Problem |
|
||||
|---|---|---|
|
||||
| A | 215 | Kth Largest in Array |
|
||||
| A | 703 | Kth Largest in Stream |
|
||||
| A | 973 | K Closest Points |
|
||||
| A | 621 | Task Scheduler |
|
||||
| A | 23 | Merge K Sorted Lists |
|
||||
| B | 1046 | Last Stone Weight |
|
||||
| B | 373 | K Pairs with Smallest Sums |
|
||||
| B ⭐ | 295 | Find Median from Data Stream |
|
||||
| B ⭐ | 502 | IPO |
|
||||
|
||||
### 15. Trie — builds on 11
|
||||
| Set | LC # | Problem |
|
||||
|---|---|---|
|
||||
| A | 208 | Implement Trie |
|
||||
| A | 211 | Add & Search Words |
|
||||
| B | 212 | Word Search II *(needs topic 20 — schedule after)* |
|
||||
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th align="left">Topic</th>
|
||||
<th align="center">Set</th>
|
||||
<th align="center">LC #</th>
|
||||
<th align="left">Problem</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td rowspan="10"><strong>11. Tree DFS</strong><br><sub>builds on recursion</sub></td>
|
||||
<td align="center"><code>A</code></td><td align="center">226</td><td><a href="https://leetcode.com/problems/invert-binary-tree/">Invert Binary Tree</a></td>
|
||||
</tr>
|
||||
<tr><td align="center"><code>A</code></td><td align="center">104</td><td><a href="https://leetcode.com/problems/maximum-depth-of-binary-tree/">Maximum Depth of Binary Tree</a></td></tr>
|
||||
<tr><td align="center"><code>A</code></td><td align="center">100</td><td><a href="https://leetcode.com/problems/same-tree/">Same Tree</a></td></tr>
|
||||
<tr><td align="center"><code>A</code></td><td align="center">572</td><td><a href="https://leetcode.com/problems/subtree-of-another-tree/">Subtree of Another Tree</a></td></tr>
|
||||
<tr><td align="center"><code>A</code></td><td align="center">236</td><td><a href="https://leetcode.com/problems/lowest-common-ancestor-of-a-binary-tree/">Lowest Common Ancestor</a></td></tr>
|
||||
<tr><td align="center"><code>A</code> ⭐</td><td align="center">124</td><td><a href="https://leetcode.com/problems/binary-tree-maximum-path-sum/">Binary Tree Maximum Path Sum</a></td></tr>
|
||||
<tr><td align="center"><code>B</code></td><td align="center">101</td><td><a href="https://leetcode.com/problems/symmetric-tree/">Symmetric Tree</a></td></tr>
|
||||
<tr><td align="center"><code>B</code></td><td align="center">112</td><td><a href="https://leetcode.com/problems/path-sum/">Path Sum</a></td></tr>
|
||||
<tr><td align="center"><code>B</code></td><td align="center">129</td><td><a href="https://leetcode.com/problems/sum-root-to-leaf-numbers/">Sum Root to Leaf Numbers</a></td></tr>
|
||||
<tr><td align="center"><code>B</code></td><td align="center">543</td><td><a href="https://leetcode.com/problems/diameter-of-binary-tree/">Diameter of Binary Tree</a></td></tr>
|
||||
<tr>
|
||||
<td rowspan="5"><strong>12. Tree BFS</strong><br><sub>builds on 6's sibling (queue) + 11</sub></td>
|
||||
<td align="center"><code>A</code></td><td align="center">102</td><td><a href="https://leetcode.com/problems/binary-tree-level-order-traversal/">Level Order Traversal</a></td>
|
||||
</tr>
|
||||
<tr><td align="center"><code>A</code></td><td align="center">199</td><td><a href="https://leetcode.com/problems/binary-tree-right-side-view/">Right Side View</a></td></tr>
|
||||
<tr><td align="center"><code>A</code></td><td align="center">1448</td><td><a href="https://leetcode.com/problems/count-good-nodes-in-binary-tree/">Count Good Nodes</a></td></tr>
|
||||
<tr><td align="center"><code>B</code></td><td align="center">103</td><td><a href="https://leetcode.com/problems/binary-tree-zigzag-level-order-traversal/">Zigzag Level Order</a></td></tr>
|
||||
<tr><td align="center"><code>B</code></td><td align="center">637</td><td><a href="https://leetcode.com/problems/average-of-levels-in-binary-tree/">Average of Levels</a></td></tr>
|
||||
<tr>
|
||||
<td rowspan="7"><strong>13. Binary Search Tree</strong><br><sub>builds on 5 + 11</sub></td>
|
||||
<td align="center"><code>A</code></td><td align="center">98</td><td><a href="https://leetcode.com/problems/validate-binary-search-tree/">Validate BST</a></td>
|
||||
</tr>
|
||||
<tr><td align="center"><code>A</code></td><td align="center">230</td><td><a href="https://leetcode.com/problems/kth-smallest-element-in-a-bst/">Kth Smallest in BST</a></td></tr>
|
||||
<tr><td align="center"><code>A</code></td><td align="center">235</td><td><a href="https://leetcode.com/problems/lowest-common-ancestor-of-a-binary-search-tree/">LCA of BST</a></td></tr>
|
||||
<tr><td align="center"><code>A</code></td><td align="center">105</td><td><a href="https://leetcode.com/problems/construct-binary-tree-from-preorder-and-inorder-traversal/">Build from Preorder + Inorder</a></td></tr>
|
||||
<tr><td align="center"><code>B</code></td><td align="center">530</td><td><a href="https://leetcode.com/problems/minimum-absolute-difference-in-bst/">Minimum Absolute Difference</a></td></tr>
|
||||
<tr><td align="center"><code>B</code></td><td align="center">173</td><td><a href="https://leetcode.com/problems/binary-search-tree-iterator/">BST Iterator</a></td></tr>
|
||||
<tr><td align="center"><code>B</code></td><td align="center">108</td><td><a href="https://leetcode.com/problems/convert-sorted-array-to-binary-search-tree/">Sorted Array to BST</a></td></tr>
|
||||
<tr>
|
||||
<td rowspan="9"><strong>14. Heap / Priority Queue</strong><br><sub>implicit tree over array</sub></td>
|
||||
<td align="center"><code>A</code></td><td align="center">215</td><td><a href="https://leetcode.com/problems/kth-largest-element-in-an-array/">Kth Largest in Array</a></td>
|
||||
</tr>
|
||||
<tr><td align="center"><code>A</code></td><td align="center">703</td><td><a href="https://leetcode.com/problems/kth-largest-element-in-a-stream/">Kth Largest in Stream</a></td></tr>
|
||||
<tr><td align="center"><code>A</code></td><td align="center">973</td><td><a href="https://leetcode.com/problems/k-closest-points-to-origin/">K Closest Points</a></td></tr>
|
||||
<tr><td align="center"><code>A</code></td><td align="center">621</td><td><a href="https://leetcode.com/problems/task-scheduler/">Task Scheduler</a></td></tr>
|
||||
<tr><td align="center"><code>A</code></td><td align="center">23</td><td><a href="https://leetcode.com/problems/merge-k-sorted-lists/">Merge K Sorted Lists</a></td></tr>
|
||||
<tr><td align="center"><code>B</code></td><td align="center">1046</td><td><a href="https://leetcode.com/problems/last-stone-weight/">Last Stone Weight</a></td></tr>
|
||||
<tr><td align="center"><code>B</code></td><td align="center">373</td><td><a href="https://leetcode.com/problems/find-k-pairs-with-smallest-sums/">K Pairs with Smallest Sums</a></td></tr>
|
||||
<tr><td align="center"><code>B</code> ⭐</td><td align="center">295</td><td><a href="https://leetcode.com/problems/find-median-from-data-stream/">Find Median from Data Stream</a></td></tr>
|
||||
<tr><td align="center"><code>B</code> ⭐</td><td align="center">502</td><td><a href="https://leetcode.com/problems/ipo/">IPO</a></td></tr>
|
||||
<tr>
|
||||
<td rowspan="3"><strong>15. Trie</strong><br><sub>builds on 11</sub></td>
|
||||
<td align="center"><code>A</code></td><td align="center">208</td><td><a href="https://leetcode.com/problems/implement-trie-prefix-tree/">Implement Trie</a></td>
|
||||
</tr>
|
||||
<tr><td align="center"><code>A</code></td><td align="center">211</td><td><a href="https://leetcode.com/problems/design-add-and-search-words-data-structure/">Add & Search Words</a></td></tr>
|
||||
<tr><td align="center"><code>B</code></td><td align="center">212</td><td><a href="https://leetcode.com/problems/word-search-ii/">Word Search II</a> <sub>(needs topic 20 — schedule after)</sub></td></tr>
|
||||
</tbody>
|
||||
</table>
|
||||
---
|
||||
|
||||
## Phase IV — Relational Structures (Week 4)
|
||||
|
||||
### 16. Graph DFS — builds on 11 + visited set
|
||||
| Set | LC # | Problem |
|
||||
|---|---|---|
|
||||
| A | 200 | Number of Islands |
|
||||
| A | 695 | Max Area of Island |
|
||||
| A | 133 | Clone Graph |
|
||||
| A | 417 | Pacific Atlantic Water Flow |
|
||||
| A | 130 | Surrounded Regions |
|
||||
| B | 399 | Evaluate Division |
|
||||
| B | 261 | Graph Valid Tree |
|
||||
|
||||
### 17. Graph BFS — builds on 12 + visited set
|
||||
| Set | LC # | Problem |
|
||||
|---|---|---|
|
||||
| A | 994 | Rotting Oranges |
|
||||
| A | 127 | Word Ladder |
|
||||
| B | 909 | Snakes and Ladders |
|
||||
| B | 433 | Minimum Genetic Mutation |
|
||||
| B | 286 | Walls and Gates |
|
||||
|
||||
### 18. Topological Sort — builds on 16
|
||||
| Set | LC # | Problem |
|
||||
|---|---|---|
|
||||
| A | 207 | Course Schedule |
|
||||
| A | 210 | Course Schedule II |
|
||||
| B ⭐ | 269 | Alien Dictionary |
|
||||
| B | 1462 | Course Schedule IV |
|
||||
|
||||
### 19. Union-Find — builds on 16's problem class
|
||||
| Set | LC # | Problem |
|
||||
|---|---|---|
|
||||
| A | 684 | Redundant Connection |
|
||||
| A | 323 | Number of Connected Components |
|
||||
| B | 128 | Longest Consecutive (union-find variant) |
|
||||
| B | 721 | Accounts Merge |
|
||||
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th align="left">Topic</th>
|
||||
<th align="center">Set</th>
|
||||
<th align="center">LC #</th>
|
||||
<th align="left">Problem</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td rowspan="7"><strong>16. Graph DFS</strong><br><sub>builds on 11 + visited set</sub></td>
|
||||
<td align="center"><code>A</code></td><td align="center">200</td><td><a href="https://leetcode.com/problems/number-of-islands/">Number of Islands</a></td>
|
||||
</tr>
|
||||
<tr><td align="center"><code>A</code></td><td align="center">695</td><td><a href="https://leetcode.com/problems/max-area-of-island/">Max Area of Island</a></td></tr>
|
||||
<tr><td align="center"><code>A</code></td><td align="center">133</td><td><a href="https://leetcode.com/problems/clone-graph/">Clone Graph</a></td></tr>
|
||||
<tr><td align="center"><code>A</code></td><td align="center">417</td><td><a href="https://leetcode.com/problems/pacific-atlantic-water-flow/">Pacific Atlantic Water Flow</a></td></tr>
|
||||
<tr><td align="center"><code>A</code></td><td align="center">130</td><td><a href="https://leetcode.com/problems/surrounded-regions/">Surrounded Regions</a></td></tr>
|
||||
<tr><td align="center"><code>B</code></td><td align="center">399</td><td><a href="https://leetcode.com/problems/evaluate-division/">Evaluate Division</a></td></tr>
|
||||
<tr><td align="center"><code>B</code></td><td align="center">261</td><td><a href="https://leetcode.com/problems/graph-valid-tree/">Graph Valid Tree</a></td></tr>
|
||||
<tr>
|
||||
<td rowspan="5"><strong>17. Graph BFS</strong><br><sub>builds on 12 + visited set — shortest path unweighted</sub></td>
|
||||
<td align="center"><code>A</code></td><td align="center">994</td><td><a href="https://leetcode.com/problems/rotting-oranges/">Rotting Oranges</a></td>
|
||||
</tr>
|
||||
<tr><td align="center"><code>A</code></td><td align="center">127</td><td><a href="https://leetcode.com/problems/word-ladder/">Word Ladder</a></td></tr>
|
||||
<tr><td align="center"><code>B</code></td><td align="center">909</td><td><a href="https://leetcode.com/problems/snakes-and-ladders/">Snakes and Ladders</a></td></tr>
|
||||
<tr><td align="center"><code>B</code></td><td align="center">433</td><td><a href="https://leetcode.com/problems/minimum-genetic-mutation/">Minimum Genetic Mutation</a></td></tr>
|
||||
<tr><td align="center"><code>B</code></td><td align="center">286</td><td><a href="https://leetcode.com/problems/walls-and-gates/">Walls and Gates</a></td></tr>
|
||||
<tr>
|
||||
<td rowspan="4"><strong>18. Topological Sort</strong><br><sub>builds on 16</sub></td>
|
||||
<td align="center"><code>A</code></td><td align="center">207</td><td><a href="https://leetcode.com/problems/course-schedule/">Course Schedule</a></td>
|
||||
</tr>
|
||||
<tr><td align="center"><code>A</code></td><td align="center">210</td><td><a href="https://leetcode.com/problems/course-schedule-ii/">Course Schedule II</a></td></tr>
|
||||
<tr><td align="center"><code>B</code> ⭐</td><td align="center">269</td><td><a href="https://leetcode.com/problems/alien-dictionary/">Alien Dictionary</a></td></tr>
|
||||
<tr><td align="center"><code>B</code></td><td align="center">1462</td><td><a href="https://leetcode.com/problems/course-schedule-iv/">Course Schedule IV</a></td></tr>
|
||||
<tr>
|
||||
<td rowspan="4"><strong>19. Union-Find</strong><br><sub>builds on 16's problem class</sub></td>
|
||||
<td align="center"><code>A</code></td><td align="center">684</td><td><a href="https://leetcode.com/problems/redundant-connection/">Redundant Connection</a></td>
|
||||
</tr>
|
||||
<tr><td align="center"><code>A</code></td><td align="center">323</td><td><a href="https://leetcode.com/problems/number-of-connected-components-in-an-undirected-graph/">Number of Connected Components</a></td></tr>
|
||||
<tr><td align="center"><code>B</code></td><td align="center">128</td><td><a href="https://leetcode.com/problems/longest-consecutive-sequence/">Longest Consecutive (union-find variant)</a></td></tr>
|
||||
<tr><td align="center"><code>B</code></td><td align="center">721</td><td><a href="https://leetcode.com/problems/accounts-merge/">Accounts Merge</a></td></tr>
|
||||
</tbody>
|
||||
</table>
|
||||
---
|
||||
|
||||
## Phase V — Decision-Space Exploration (Weeks 4–5)
|
||||
|
||||
### 20. Backtracking — builds on 16
|
||||
| Set | LC # | Problem |
|
||||
|---|---|---|
|
||||
| A | 78 | Subsets |
|
||||
| A | 39 | Combination Sum |
|
||||
| A | 46 | Permutations |
|
||||
| A | 79 | Word Search |
|
||||
| B | 17 | Letter Combinations |
|
||||
| B | 77 | Combinations |
|
||||
| B | 22 | Generate Parentheses |
|
||||
| B ⭐ | 52 | N-Queens II |
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th align="left">Topic</th>
|
||||
<th align="center">Set</th>
|
||||
<th align="center">LC #</th>
|
||||
<th align="left">Problem</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td rowspan="8"><strong>20. Backtracking</strong><br><sub>builds on 16 — then unlock LC 212 from topic 15</sub></td>
|
||||
<td align="center"><code>A</code></td><td align="center">78</td><td><a href="https://leetcode.com/problems/subsets/">Subsets</a></td>
|
||||
</tr>
|
||||
<tr><td align="center"><code>A</code></td><td align="center">39</td><td><a href="https://leetcode.com/problems/combination-sum/">Combination Sum</a></td></tr>
|
||||
<tr><td align="center"><code>A</code></td><td align="center">46</td><td><a href="https://leetcode.com/problems/permutations/">Permutations</a></td></tr>
|
||||
<tr><td align="center"><code>A</code></td><td align="center">79</td><td><a href="https://leetcode.com/problems/word-search/">Word Search</a></td></tr>
|
||||
<tr><td align="center"><code>B</code></td><td align="center">17</td><td><a href="https://leetcode.com/problems/letter-combinations-of-a-phone-number/">Letter Combinations</a></td></tr>
|
||||
<tr><td align="center"><code>B</code></td><td align="center">77</td><td><a href="https://leetcode.com/problems/combinations/">Combinations</a></td></tr>
|
||||
<tr><td align="center"><code>B</code></td><td align="center">22</td><td><a href="https://leetcode.com/problems/generate-parentheses/">Generate Parentheses</a></td></tr>
|
||||
<tr><td align="center"><code>B</code> ⭐</td><td align="center">52</td><td><a href="https://leetcode.com/problems/n-queens-ii/">N-Queens II</a></td></tr>
|
||||
<tr>
|
||||
<td rowspan="9"><strong>21. 1-D Dynamic Programming</strong><br><sub>builds on 20</sub></td>
|
||||
<td align="center"><code>A</code></td><td align="center">70</td><td><a href="https://leetcode.com/problems/climbing-stairs/">Climbing Stairs</a></td>
|
||||
</tr>
|
||||
<tr><td align="center"><code>A</code></td><td align="center">746</td><td><a href="https://leetcode.com/problems/min-cost-climbing-stairs/">Min Cost Climbing Stairs</a></td></tr>
|
||||
<tr><td align="center"><code>A</code></td><td align="center">198</td><td><a href="https://leetcode.com/problems/house-robber/">House Robber</a></td></tr>
|
||||
<tr><td align="center"><code>A</code></td><td align="center">213</td><td><a href="https://leetcode.com/problems/house-robber-ii/">House Robber II</a></td></tr>
|
||||
<tr><td align="center"><code>A</code></td><td align="center">322</td><td><a href="https://leetcode.com/problems/coin-change/">Coin Change</a></td></tr>
|
||||
<tr><td align="center"><code>A</code></td><td align="center">300</td><td><a href="https://leetcode.com/problems/longest-increasing-subsequence/">Longest Increasing Subsequence</a></td></tr>
|
||||
<tr><td align="center"><code>B</code></td><td align="center">139</td><td><a href="https://leetcode.com/problems/word-break/">Word Break</a></td></tr>
|
||||
<tr><td align="center"><code>B</code></td><td align="center">91</td><td><a href="https://leetcode.com/problems/decode-ways/">Decode Ways</a></td></tr>
|
||||
<tr><td align="center"><code>B</code></td><td align="center">647</td><td><a href="https://leetcode.com/problems/palindromic-substrings/">Palindromic Substrings</a></td></tr>
|
||||
<tr>
|
||||
<td rowspan="8"><strong>22. Multi-D / Grid DP</strong><br><sub>builds on 21</sub></td>
|
||||
<td align="center"><code>A</code></td><td align="center">62</td><td><a href="https://leetcode.com/problems/unique-paths/">Unique Paths</a></td>
|
||||
</tr>
|
||||
<tr><td align="center"><code>A</code></td><td align="center">64</td><td><a href="https://leetcode.com/problems/minimum-path-sum/">Minimum Path Sum</a></td></tr>
|
||||
<tr><td align="center"><code>A</code></td><td align="center">1143</td><td><a href="https://leetcode.com/problems/longest-common-subsequence/">Longest Common Subsequence</a></td></tr>
|
||||
<tr><td align="center"><code>B</code></td><td align="center">120</td><td><a href="https://leetcode.com/problems/triangle/">Triangle</a></td></tr>
|
||||
<tr><td align="center"><code>B</code></td><td align="center">63</td><td><a href="https://leetcode.com/problems/unique-paths-ii/">Unique Paths II</a></td></tr>
|
||||
<tr><td align="center"><code>B</code> ⭐</td><td align="center">72</td><td><a href="https://leetcode.com/problems/edit-distance/">Edit Distance</a></td></tr>
|
||||
<tr><td align="center"><code>B</code></td><td align="center">221</td><td><a href="https://leetcode.com/problems/maximal-square/">Maximal Square</a></td></tr>
|
||||
<tr><td align="center"><code>B</code> ⭐</td><td align="center">97</td><td><a href="https://leetcode.com/problems/interleaving-string/">Interleaving String</a></td></tr>
|
||||
<tr>
|
||||
<td rowspan="7"><strong>23. Greedy</strong><br><sub>builds on 21 — includes Kadane's</sub></td>
|
||||
<td align="center"><code>A</code></td><td align="center">53</td><td><a href="https://leetcode.com/problems/maximum-subarray/">Maximum Subarray</a></td>
|
||||
</tr>
|
||||
<tr><td align="center"><code>A</code></td><td align="center">55</td><td><a href="https://leetcode.com/problems/jump-game/">Jump Game</a></td></tr>
|
||||
<tr><td align="center"><code>A</code></td><td align="center">45</td><td><a href="https://leetcode.com/problems/jump-game-ii/">Jump Game II</a></td></tr>
|
||||
<tr><td align="center"><code>A</code></td><td align="center">134</td><td><a href="https://leetcode.com/problems/gas-station/">Gas Station</a></td></tr>
|
||||
<tr><td align="center"><code>B</code></td><td align="center">122</td><td><a href="https://leetcode.com/problems/best-time-to-buy-and-sell-stock-ii/">Best Time to Buy and Sell Stock II</a></td></tr>
|
||||
<tr><td align="center"><code>B</code></td><td align="center">918</td><td><a href="https://leetcode.com/problems/maximum-sum-circular-subarray/">Maximum Sum Circular Subarray</a></td></tr>
|
||||
<tr><td align="center"><code>B</code></td><td align="center">763</td><td><a href="https://leetcode.com/problems/partition-labels/">Partition Labels</a></td></tr>
|
||||
<tr>
|
||||
<td rowspan="7"><strong>24. Intervals</strong><br><sub>builds on 23</sub></td>
|
||||
<td align="center"><code>A</code></td><td align="center">57</td><td><a href="https://leetcode.com/problems/insert-interval/">Insert Interval</a></td>
|
||||
</tr>
|
||||
<tr><td align="center"><code>A</code></td><td align="center">56</td><td><a href="https://leetcode.com/problems/merge-intervals/">Merge Intervals</a></td></tr>
|
||||
<tr><td align="center"><code>A</code></td><td align="center">435</td><td><a href="https://leetcode.com/problems/non-overlapping-intervals/">Non-Overlapping Intervals</a></td></tr>
|
||||
<tr><td align="center"><code>A</code></td><td align="center">253</td><td><a href="https://leetcode.com/problems/meeting-rooms-ii/">Meeting Rooms II</a></td></tr>
|
||||
<tr><td align="center"><code>B</code></td><td align="center">228</td><td><a href="https://leetcode.com/problems/summary-ranges/">Summary Ranges</a></td></tr>
|
||||
<tr><td align="center"><code>B</code></td><td align="center">452</td><td><a href="https://leetcode.com/problems/minimum-number-of-arrows-to-burst-balloons/">Minimum Arrows to Burst Balloons</a></td></tr>
|
||||
<tr><td align="center"><code>B</code></td><td align="center">252</td><td><a href="https://leetcode.com/problems/meeting-rooms/">Meeting Rooms I</a></td></tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
## Dependency Spine (Mermaid)
|
||||
|
||||
*(Now unlock 212 Word Search II from topic 15.)*
|
||||
|
||||
### 21. 1-D Dynamic Programming — builds on 20
|
||||
| Set | LC # | Problem |
|
||||
|---|---|---|
|
||||
| A | 70 | Climbing Stairs |
|
||||
| A | 746 | Min Cost Climbing Stairs |
|
||||
| A | 198 | House Robber |
|
||||
| A | 213 | House Robber II |
|
||||
| A | 322 | Coin Change |
|
||||
| A | 300 | Longest Increasing Subsequence |
|
||||
| B | 139 | Word Break |
|
||||
| B | 91 | Decode Ways |
|
||||
| B | 647 | Palindromic Substrings |
|
||||
|
||||
### 22. Multi-D / Grid DP — builds on 21
|
||||
| Set | LC # | Problem |
|
||||
|---|---|---|
|
||||
| A | 62 | Unique Paths |
|
||||
| A | 64 | Minimum Path Sum |
|
||||
| A | 1143 | Longest Common Subsequence |
|
||||
| B | 120 | Triangle |
|
||||
| B | 63 | Unique Paths II |
|
||||
| B ⭐ | 72 | Edit Distance |
|
||||
| B | 221 | Maximal Square |
|
||||
| B ⭐ | 97 | Interleaving String |
|
||||
|
||||
### 23. Greedy — builds on 21
|
||||
| Set | LC # | Problem |
|
||||
|---|---|---|
|
||||
| A | 53 | Maximum Subarray (Kadane's) |
|
||||
| A | 55 | Jump Game |
|
||||
| A | 45 | Jump Game II |
|
||||
| A | 134 | Gas Station |
|
||||
| B | 122 | Best Time to Buy and Sell Stock II |
|
||||
| B | 918 | Maximum Sum Circular Subarray |
|
||||
| B | 763 | Partition Labels |
|
||||
|
||||
### 24. Intervals — builds on 23
|
||||
| Set | LC # | Problem |
|
||||
|---|---|---|
|
||||
| A | 57 | Insert Interval |
|
||||
| A | 56 | Merge Intervals |
|
||||
| A | 435 | Non-Overlapping Intervals |
|
||||
| A | 253 | Meeting Rooms II |
|
||||
| B | 228 | Summary Ranges |
|
||||
| B | 452 | Minimum Arrows to Burst Balloons |
|
||||
| B | 920 | Meeting Rooms I |
|
||||
```mermaid
|
||||
graph LR
|
||||
T1["1 Hash"] --> T2["2 Prefix Sum"]
|
||||
T3["3 Two Pointers"] --> T4["4 Sliding Window"]
|
||||
T4 --> T10["10 Matrix Index Math"]
|
||||
T5["5 Binary Search"] --> T13["13 BST"]
|
||||
T6["6 Stack"] --> T7["7 Monotonic Stack"]
|
||||
T8["8 Linked List"] --> T9["9 Hybrid"]
|
||||
T1 --> T9
|
||||
T11["11 Tree DFS"] --> T13
|
||||
T11 --> T14["14 Heap"]
|
||||
T11 --> T15["15 Trie"]
|
||||
T11 --> T16["16 Graph DFS"]
|
||||
T12["12 Tree BFS"] --> T17["17 Graph BFS"]
|
||||
T16 --> T18["18 Topological Sort"]
|
||||
T16 --> T19["19 Union-Find"]
|
||||
T18 --> T20["20 Backtracking"]
|
||||
T20 --> T21["21 DP 1-D"]
|
||||
T21 --> T22["22 DP Multi-D"]
|
||||
T21 --> T23["23 Greedy"]
|
||||
T23 --> T24["24 Intervals"]
|
||||
```
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
---
|
||||
title: 'Hashing'
|
||||
description: 'In algorithms, arrays and strings are very similar. They are both ordered collections of elements. The difference is that arrays are mutable, while strings are immutable.'
|
||||
sidebar:
|
||||
label: Hashing
|
||||
---
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
---
|
||||
title: 'Binary Search'
|
||||
description: 'In algorithms, arrays and strings are very similar. They are both ordered collections of elements. The difference is that arrays are mutable, while strings are immutable.'
|
||||
---
|
||||
|
||||
|
||||
Technically, an array can't be resized. A dynamic array, or list, can be. In the context of algorithm problems, usually when people talk about arrays, they are referring to dynamic arrays. In this entire course, we will be talking about dynamic arrays/lists, but we will just use the word "array".
|
||||
|
||||
## Time Complexity
|
||||
|
||||
Arrays and strings are both ordered collections of elements. The difference is that arrays are mutable, while strings are immutable.
|
||||
|
||||
| Operation | Array/List | String(Immutable) |
|
||||
| --------- | ---------- | ----------------- |
|
||||
| Appending to end | *O(1) | O(n) |
|
||||
| Popping from end | O(1) | O(n) |
|
||||
| Insertion, not from end | O(n) | O(n) |
|
||||
| Deletion, not from end | O(n) | O(n) |
|
||||
| Modifying an element | O(1) | O(n) |
|
||||
| Random access | *O(1) | O(n) |
|
||||
| Checking if an element exists | O(1) | O(n) |
|
||||
|
||||
:::note[Clarification 1]
|
||||
Appending to the end of a list is amortized O(1) time complexity. This means that the time complexity of appending to the end of a list is the same as the time complexity of appending to the end of an array.
|
||||
:::
|
||||
|
||||
:::note[Clarification 2]
|
||||
Random access in this context means that you can access an element at any index in constant time.
|
||||
:::
|
||||
|
||||
@@ -12,11 +12,3 @@ This page is a scaffold. Notes, canonical problems, and template code are not wr
|
||||
|
||||
|
||||
|
||||
## Problems
|
||||
|
||||
<CardGroup cols={2}>
|
||||
<Card title="344. Reverse String" href="/problems/reverse-string">
|
||||
</Card>
|
||||
<Card title="977. Squares of a Sorted Array" href="/problems/squares-of-a-sorted-array">
|
||||
</Card>
|
||||
</CardGroup>
|
||||
|
||||
Reference in New Issue
Block a user