mirror of
https://github.com/prdlk/leetcode.git
synced 2026-09-16 23:16:26 +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)
|
## Phase I — Linear Structures (Week 1)
|
||||||
|
|
||||||
### 1. Hash-Based Lookup — builds on nothing
|
<table>
|
||||||
| Set | LC # | Problem |
|
<thead>
|
||||||
|---|---|---|
|
<tr>
|
||||||
| A | 217 | Contains Duplicate |
|
<th align="left">Topic</th>
|
||||||
| A | 242 | Valid Anagram |
|
<th align="center">Set</th>
|
||||||
| A | 1 | Two Sum |
|
<th align="center">LC #</th>
|
||||||
| A | 49 | Group Anagrams |
|
<th align="left">Problem</th>
|
||||||
| A | 347 | Top K Frequent Elements |
|
</tr>
|
||||||
| B | 383 | Ransom Note |
|
</thead>
|
||||||
| B | 205 | Isomorphic Strings |
|
<tbody>
|
||||||
| B | 128 | Longest Consecutive Sequence |
|
<tr>
|
||||||
| B | 290 | Word Pattern |
|
<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>
|
||||||
### 2. Prefix Sum — builds on 1
|
</tr>
|
||||||
| Set | LC # | Problem |
|
<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>
|
||||||
| A | 303 | Range Sum Query |
|
<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>
|
||||||
| A | 238 | Product of Array Except Self |
|
<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>
|
||||||
| A | 560 | Subarray Sum Equals K |
|
<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>
|
||||||
| B | 525 | Contiguous Array |
|
<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>
|
||||||
| B | 974 | Subarray Sums Divisible by K |
|
<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>
|
||||||
### 3. Two Pointers — builds on ordered iteration
|
<tr>
|
||||||
| Set | LC # | Problem |
|
<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>
|
||||||
| A | 125 | Valid Palindrome |
|
</tr>
|
||||||
| A | 167 | Two Sum II |
|
<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>
|
||||||
| A | 15 | 3Sum |
|
<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>
|
||||||
| A | 11 | Container With Most Water |
|
<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>
|
||||||
| A | 42 | Trapping Rain Water |
|
<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>
|
||||||
| B | 392 | Is Subsequence |
|
<tr>
|
||||||
| B | 977 | Squares of a Sorted Array |
|
<td rowspan="9"><strong>3. Two Pointers</strong><br><sub>builds on ordered iteration</sub></td>
|
||||||
| B | 189 | Rotate Array |
|
<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>
|
||||||
| B | 80 | Remove Duplicates II |
|
</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>
|
||||||
### 4. Sliding Window — builds on 3
|
<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>
|
||||||
| Set | LC # | Problem |
|
<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>
|
||||||
| A | 121 | Best Time to Buy and Sell Stock |
|
<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>
|
||||||
| A | 3 | Longest Substring Without Repeating Characters |
|
<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>
|
||||||
| A | 424 | Longest Repeating Character Replacement |
|
<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>
|
||||||
| A | 567 | Permutation in String |
|
<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>
|
||||||
| A | 76 | Minimum Window Substring |
|
<tr>
|
||||||
| B | 209 | Minimum Size Subarray Sum |
|
<td rowspan="8"><strong>4. Sliding Window</strong><br><sub>builds on 3</sub></td>
|
||||||
| B | 1004 | Max Consecutive Ones III |
|
<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>
|
||||||
| B | 643 | Maximum Average Subarray |
|
</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>
|
||||||
### 5. Binary Search — builds on ordered/monotonic invariants
|
<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>
|
||||||
| Set | LC # | Problem |
|
<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>
|
||||||
| A | 704 | Binary Search |
|
<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>
|
||||||
| A | 74 | Search a 2D Matrix |
|
<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>
|
||||||
| A | 875 | Koko Eating Bananas |
|
<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>
|
||||||
| A | 33 | Search in Rotated Sorted Array |
|
<tr>
|
||||||
| A | 153 | Find Minimum in Rotated Sorted Array |
|
<td rowspan="9"><strong>5. Binary Search</strong><br><sub>builds on ordered / monotonic invariants</sub></td>
|
||||||
| B | 35 | Search Insert Position |
|
<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>
|
||||||
| B | 162 | Find Peak Element |
|
</tr>
|
||||||
| B | 34 | First & Last Position |
|
<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>
|
||||||
| B ⭐ | 4 | Median of Two Sorted Arrays |
|
<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>
|
||||||
### 6. Stack — independent primitive
|
<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>
|
||||||
| Set | LC # | Problem |
|
<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>
|
||||||
| A | 20 | Valid Parentheses |
|
<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>
|
||||||
| A | 155 | Min Stack |
|
<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>
|
||||||
| A | 150 | Evaluate Reverse Polish Notation |
|
<tr>
|
||||||
| B | 71 | Simplify Path |
|
<td rowspan="5"><strong>6. Stack</strong><br><sub>independent primitive</sub></td>
|
||||||
| B ⭐ | 224 | Basic Calculator |
|
<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>
|
||||||
### 7. Monotonic Stack — builds on 6
|
<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>
|
||||||
| Set | LC # | Problem |
|
<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>
|
||||||
| A | 739 | Daily Temperatures |
|
<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>
|
||||||
| A | 853 | Car Fleet |
|
<tr>
|
||||||
| B | 496 | Next Greater Element I |
|
<td rowspan="5"><strong>7. Monotonic Stack</strong><br><sub>builds on 6</sub></td>
|
||||||
| B | 901 | Online Stock Span |
|
<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>
|
||||||
| B ⭐ | 84 | Largest Rectangle in Histogram |
|
</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)
|
## 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 |
|
|
||||||
|
|
||||||
|
<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)
|
## Phase III — Hierarchical Structures (Week 3)
|
||||||
|
|
||||||
### 11. Tree DFS — builds on recursion
|
<table>
|
||||||
| Set | LC # | Problem |
|
<thead>
|
||||||
|---|---|---|
|
<tr>
|
||||||
| A | 226 | Invert Binary Tree |
|
<th align="left">Topic</th>
|
||||||
| A | 104 | Maximum Depth of Binary Tree |
|
<th align="center">Set</th>
|
||||||
| A | 100 | Same Tree |
|
<th align="center">LC #</th>
|
||||||
| A | 572 | Subtree of Another Tree |
|
<th align="left">Problem</th>
|
||||||
| A | 236 | Lowest Common Ancestor |
|
</tr>
|
||||||
| A ⭐ | 124 | Binary Tree Maximum Path Sum |
|
</thead>
|
||||||
| B | 101 | Symmetric Tree |
|
<tbody>
|
||||||
| B | 112 | Path Sum |
|
<tr>
|
||||||
| B | 129 | Sum Root to Leaf Numbers |
|
<td rowspan="10"><strong>11. Tree DFS</strong><br><sub>builds on recursion</sub></td>
|
||||||
| B | 543 | Diameter of Binary Tree |
|
<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>
|
||||||
### 12. Tree BFS — builds on 6's sibling (queue) + 11
|
<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>
|
||||||
| Set | LC # | Problem |
|
<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>
|
||||||
| A | 102 | Level Order Traversal |
|
<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>
|
||||||
| A | 199 | Right Side View |
|
<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>
|
||||||
| A | 1448 | Count Good Nodes |
|
<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>
|
||||||
| B | 103 | Zigzag Level Order |
|
<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>
|
||||||
| B | 637 | Average of Levels |
|
<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>
|
||||||
### 13. Binary Search Tree — builds on 5 + 11
|
<tr>
|
||||||
| Set | LC # | Problem |
|
<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>
|
||||||
| A | 98 | Validate BST |
|
</tr>
|
||||||
| A | 230 | Kth Smallest in BST |
|
<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>
|
||||||
| A | 235 | LCA of BST |
|
<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>
|
||||||
| A | 105 | Build from Preorder + Inorder |
|
<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>
|
||||||
| B | 530 | Minimum Absolute Difference |
|
<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>
|
||||||
| B | 173 | BST Iterator |
|
<tr>
|
||||||
| B | 108 | Sorted Array to BST |
|
<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>
|
||||||
### 14. Heap / Priority Queue — builds on trees (implicit tree over array)
|
</tr>
|
||||||
| Set | LC # | Problem |
|
<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>
|
||||||
| A | 215 | Kth Largest in Array |
|
<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>
|
||||||
| A | 703 | Kth Largest in Stream |
|
<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>
|
||||||
| A | 973 | K Closest Points |
|
<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>
|
||||||
| A | 621 | Task Scheduler |
|
<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>
|
||||||
| A | 23 | Merge K Sorted Lists |
|
<tr>
|
||||||
| B | 1046 | Last Stone Weight |
|
<td rowspan="9"><strong>14. Heap / Priority Queue</strong><br><sub>implicit tree over array</sub></td>
|
||||||
| B | 373 | K Pairs with Smallest Sums |
|
<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>
|
||||||
| B ⭐ | 295 | Find Median from Data Stream |
|
</tr>
|
||||||
| B ⭐ | 502 | IPO |
|
<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>
|
||||||
### 15. Trie — builds on 11
|
<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>
|
||||||
| Set | LC # | Problem |
|
<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>
|
||||||
| A | 208 | Implement Trie |
|
<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>
|
||||||
| A | 211 | Add & Search Words |
|
<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>
|
||||||
| B | 212 | Word Search II *(needs topic 20 — schedule after)* |
|
<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)
|
## Phase IV — Relational Structures (Week 4)
|
||||||
|
|
||||||
### 16. Graph DFS — builds on 11 + visited set
|
<table>
|
||||||
| Set | LC # | Problem |
|
<thead>
|
||||||
|---|---|---|
|
<tr>
|
||||||
| A | 200 | Number of Islands |
|
<th align="left">Topic</th>
|
||||||
| A | 695 | Max Area of Island |
|
<th align="center">Set</th>
|
||||||
| A | 133 | Clone Graph |
|
<th align="center">LC #</th>
|
||||||
| A | 417 | Pacific Atlantic Water Flow |
|
<th align="left">Problem</th>
|
||||||
| A | 130 | Surrounded Regions |
|
</tr>
|
||||||
| B | 399 | Evaluate Division |
|
</thead>
|
||||||
| B | 261 | Graph Valid Tree |
|
<tbody>
|
||||||
|
<tr>
|
||||||
### 17. Graph BFS — builds on 12 + visited set
|
<td rowspan="7"><strong>16. Graph DFS</strong><br><sub>builds on 11 + visited set</sub></td>
|
||||||
| Set | LC # | Problem |
|
<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>
|
||||||
| A | 994 | Rotting Oranges |
|
<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>
|
||||||
| A | 127 | Word Ladder |
|
<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>
|
||||||
| B | 909 | Snakes and Ladders |
|
<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>
|
||||||
| B | 433 | Minimum Genetic Mutation |
|
<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>
|
||||||
| B | 286 | Walls and Gates |
|
<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>
|
||||||
### 18. Topological Sort — builds on 16
|
<tr>
|
||||||
| Set | LC # | Problem |
|
<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>
|
||||||
| A | 207 | Course Schedule |
|
</tr>
|
||||||
| A | 210 | Course Schedule II |
|
<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>
|
||||||
| B ⭐ | 269 | Alien Dictionary |
|
<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>
|
||||||
| B | 1462 | Course Schedule IV |
|
<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>
|
||||||
### 19. Union-Find — builds on 16's problem class
|
<tr>
|
||||||
| Set | LC # | Problem |
|
<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>
|
||||||
| A | 684 | Redundant Connection |
|
</tr>
|
||||||
| A | 323 | Number of Connected Components |
|
<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>
|
||||||
| B | 128 | Longest Consecutive (union-find variant) |
|
<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>
|
||||||
| B | 721 | Accounts Merge |
|
<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)
|
## Phase V — Decision-Space Exploration (Weeks 4–5)
|
||||||
|
|
||||||
### 20. Backtracking — builds on 16
|
<table>
|
||||||
| Set | LC # | Problem |
|
<thead>
|
||||||
|---|---|---|
|
<tr>
|
||||||
| A | 78 | Subsets |
|
<th align="left">Topic</th>
|
||||||
| A | 39 | Combination Sum |
|
<th align="center">Set</th>
|
||||||
| A | 46 | Permutations |
|
<th align="center">LC #</th>
|
||||||
| A | 79 | Word Search |
|
<th align="left">Problem</th>
|
||||||
| B | 17 | Letter Combinations |
|
</tr>
|
||||||
| B | 77 | Combinations |
|
</thead>
|
||||||
| B | 22 | Generate Parentheses |
|
<tbody>
|
||||||
| B ⭐ | 52 | N-Queens II |
|
<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>
|
||||||
|
|
||||||
*(Now unlock 212 Word Search II from topic 15.)*
|
## Dependency Spine (Mermaid)
|
||||||
|
|
||||||
### 21. 1-D Dynamic Programming — builds on 20
|
```mermaid
|
||||||
| Set | LC # | Problem |
|
graph LR
|
||||||
|---|---|---|
|
T1["1 Hash"] --> T2["2 Prefix Sum"]
|
||||||
| A | 70 | Climbing Stairs |
|
T3["3 Two Pointers"] --> T4["4 Sliding Window"]
|
||||||
| A | 746 | Min Cost Climbing Stairs |
|
T4 --> T10["10 Matrix Index Math"]
|
||||||
| A | 198 | House Robber |
|
T5["5 Binary Search"] --> T13["13 BST"]
|
||||||
| A | 213 | House Robber II |
|
T6["6 Stack"] --> T7["7 Monotonic Stack"]
|
||||||
| A | 322 | Coin Change |
|
T8["8 Linked List"] --> T9["9 Hybrid"]
|
||||||
| A | 300 | Longest Increasing Subsequence |
|
T1 --> T9
|
||||||
| B | 139 | Word Break |
|
T11["11 Tree DFS"] --> T13
|
||||||
| B | 91 | Decode Ways |
|
T11 --> T14["14 Heap"]
|
||||||
| B | 647 | Palindromic Substrings |
|
T11 --> T15["15 Trie"]
|
||||||
|
T11 --> T16["16 Graph DFS"]
|
||||||
### 22. Multi-D / Grid DP — builds on 21
|
T12["12 Tree BFS"] --> T17["17 Graph BFS"]
|
||||||
| Set | LC # | Problem |
|
T16 --> T18["18 Topological Sort"]
|
||||||
|---|---|---|
|
T16 --> T19["19 Union-Find"]
|
||||||
| A | 62 | Unique Paths |
|
T18 --> T20["20 Backtracking"]
|
||||||
| A | 64 | Minimum Path Sum |
|
T20 --> T21["21 DP 1-D"]
|
||||||
| A | 1143 | Longest Common Subsequence |
|
T21 --> T22["22 DP Multi-D"]
|
||||||
| B | 120 | Triangle |
|
T21 --> T23["23 Greedy"]
|
||||||
| B | 63 | Unique Paths II |
|
T23 --> T24["24 Intervals"]
|
||||||
| 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 |
|
|
||||||
|
|||||||
@@ -1,8 +1,6 @@
|
|||||||
---
|
---
|
||||||
title: 'Hashing'
|
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.'
|
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