|
33 | 33 | * [Linked List](https://github.com/yuzhoujr/LeetCode#linked-list)
|
34 | 34 |
|
35 | 35 |
|
36 |
| -## Linked List |
37 |
| -[Overview](http://www.cnblogs.com/Raising-Sun/p/5970662.html#3534606) |
| 36 | + |
| 37 | + |
| 38 | + |
| 39 | + |
| 40 | + |
| 41 | + |
| 42 | + |
| 43 | + |
| 44 | + |
| 45 | + |
| 46 | + |
| 47 | + |
| 48 | + |
| 49 | + |
38 | 50 |
|
39 | 51 | ## Array Medium
|
40 | 52 | | # | Title | Solution | Time | Space | Video|
|
41 | 53 | | --- | ----- | -------- | ---- | ----- | ---- |
|
42 | 54 | |3| [Longest Substring Without Repeating Characters](https://leetcode.com/problems/longest-substring-without-repeating-characters/#/solutions) | [Python](./array/3.py) | _O(n)_| _O(n)_ ||
|
43 | 55 | |463| [Island Perimeter](https://leetcode.com/problems/island-perimeter/#/description) | [Python](./array/463.py) | _O(n^2)_| _O(1)_||
|
44 | 56 |
|
| 57 | + |
| 58 | + |
| 59 | + |
| 60 | + |
| 61 | +## Linked List |
| 62 | +[Overview](http://www.cnblogs.com/Raising-Sun/p/5970662.html#3534606) |
| 63 | + |
45 | 64 | ## Linked List Easy
|
46 | 65 | | # | Title | Solution | Time | Space | Video|
|
47 | 66 | | --- | ----- | -------- | ---- | ----- | ---- |
|
48 |
| -|21| [Merge Two Sorted Lists](https://leetcode.com/problems/merge-two-sorted-lists) | [Python](./linkedlist/MergeTwoSortedLists.py) | _O(n)_| _O(n)_ || |
49 |
| -| 89 | [Partition List](https://leetcode.com/problems/partition-list/) | [Python](./linkedlist/PartitionLinkedList.py) | _O(n)_ | _O(n)_ || |
50 |
| -| 141 | [Linked List Cycle](https://leetcode.com/problems/linked-list-cycle/#/description) | [Python](./linkedlist/LinkedListCycle.py) | _O(n)_ | _O(1)_ || |
| 67 | +|21|[Merge Two Sorted Lists](https://leetcode.com/problems/merge-two-sorted-lists) | [Python](./linkedlist/MergeTwoSortedLists.py) | _O(n)_| _O(n)_ || |
| 68 | +|89|[Partition List](https://leetcode.com/problems/partition-list/) | [Python](./linkedlist/PartitionLinkedList.py) | _O(n)_ | _O(n)_ || |
| 69 | +|141|[Linked List Cycle](https://leetcode.com/problems/linked-list-cycle/#/description) | [Python](./linkedlist/LinkedListCycle.py) | _O(n)_ | _O(1)_ || |
51 | 70 | |160|[Intersection of Two Linked Lists](https://leetcode.com/problems/intersection-of-two-linked-lists) | [Python](./linkedlist/IntersectionOfTwoLinkedLists.py) | _O(n)_| _O(1)_ ||
|
52 | 71 | |203|[Remove Linked List Elements](https://leetcode.com/problems/remove-linked-list-elements/#/description) | [Python](./linkedlist/RemoveLinkedListElements.py) | _O(n)_| _O(1)_ ||
|
53 | 72 | |206|[Reverse Linked List](https://leetcode.com/problems/reverse-linked-list/#/description) | [Python](./linkedlist/ReverseLinkedList.py) | _O(n)_| _O(1)_ || Tutorial](https://www.youtube.com/watch?v=sYcOK51hl-A&t=681s) |
|
54 | 73 | |234|[Palindrome Linked List](https://leetcode.com/problems/palindrome-linked-list/) | [Python](./linkedlist/palindrome.py) | _O(n)_| _O(1)_ ||
|
55 | 74 | |83|[Remove Duplicates from Sorted List](https://leetcode.com/problems/remove-duplicates-from-sorted-list/#/description)| [Python](./linkedlist/deleteDuplicates.py) | _O(n)_| _O(1)_ ||
|
56 | 75 |
|
| 76 | + |
57 | 77 | ## LinkedList Medium
|
58 |
| -| # | Title | Solution | Time | Space | Difficulty |Tag| Note| |
59 |
| -|-----|-------| -------- | ---- | ------|------------|---|-----| |
60 |
| -|2|[Add Two Numbers](https://leetcode.com/problems/add-two-numbers/#/description) | [Python](./linkedlist/addTwoNumbers.py) | _O(n)_| _O(n)_ | Medium |CC189| | |
61 |
| -|445| [Add Two Numbers II](https://leetcode.com/problems/add-two-numbers-ii/#/description)| [Python](./linkedlist/addTwoNumbersTwo.py) | _O(n)_| _O(n)_ | Medium |CC189 |Stack| |
62 |
| -|142|[Linked List Cycle II](https://leetcode.com/problems/linked-list-cycle-ii/#/description)| [Python](./linkedlist/detectCycleii.py) | _O(n)_| _O(1)_ | Medium |CC189 |[Video](https://www.youtube.com/watch?v=iZVBVCpmugI&t=1s)| |
63 |
| -|328|[Odd Even Linked List](https://leetcode.com/problems/odd-even-linked-list/#/description)| [Python](./linkedlist/oddEvenList.py) | _O(n)_| _O(1)_ | Medium | || |
64 |
| -|143|[Reorder List](https://leetcode.com/problems/reorder-list/#/description)| [Python](./linkedlist/reorder.py) | _O(n)_| _O(1)_ | Medium | || |
65 |
| -|24|[Swap Nodes in Pairs](https://leetcode.com/problems/swap-nodes-in-pairs/#/solutions)| [Python](./linkedlist/swapPairs.py) | _O(n)_| _O(1)_ | Medium | |[Note](http://imgur.com/a/4G6ng)| |
66 |
| -|148|[Sort List](https://leetcode.com/problems/sort-list/#/description)| [Python](./linkedlist/sortList.py) | _O(nlogn)_| _O(1)_ | Medium | || |
67 |
| -|61|[Rotate List](https://leetcode.com/problems/rotate-list/#/description)| [Python](./linkedlist/rotateRight.py) | _O(n)_| _O(1)_ | Medium | || |
68 |
| -|19|[Remove Nth Node From End of List](https://leetcode.com/problems/remove-nth-node-from-end-of-list/#/description)| [Python](./linkedlist/removeNthFromEnd.py) | _O(n)_| _O(1)_ | Medium | || |
69 |
| -|138|[Copy List with Random Pointer](https://leetcode.com/problems/copy-list-with-random-pointer/#/description)| [Python](./linkedlist/copyRandomList.py) | _O(n)_| _O(n)_ | Medium | || |
| 78 | +| # | Title | Solution | Time | Space | Video| |
| 79 | +| --- | ----- | -------- | ---- | ----- | ---- | |
| 80 | +|2|[Add Two Numbers](https://leetcode.com/problems/add-two-numbers/#/description) | [Python](./linkedlist/addTwoNumbers.py) | _O(n)_| _O(n)_| |
| 81 | +|445| [Add Two Numbers II](https://leetcode.com/problems/add-two-numbers-ii/#/description)| [Python](./linkedlist/addTwoNumbersTwo.py) | _O(n)_| _O(n)_| |
| 82 | +|142|[Linked List Cycle II](https://leetcode.com/problems/linked-list-cycle-ii/#/description)| [Python](./linkedlist/detectCycleii.py) | _O(n)_| _O(1)_|[:tv:](https://www.youtube.com/watch?v=iZVBVCpmugI&t=1s)| |
| 83 | +|328|[Odd Even Linked List](https://leetcode.com/problems/odd-even-linked-list/#/description)| [Python](./linkedlist/oddEvenList.py) | _O(n)_| _O(1)_| |
| 84 | +|143|[Reorder List](https://leetcode.com/problems/reorder-list/#/description)| [Python](./linkedlist/reorder.py) | _O(n)_| _O(1)_| |
| 85 | +|24|[Swap Nodes in Pairs](https://leetcode.com/problems/swap-nodes-in-pairs/#/solutions)| [Python](./linkedlist/swapPairs.py) | _O(n)_| _O(1)_| |
| 86 | +|148|[Sort List](https://leetcode.com/problems/sort-list/#/description)| [Python](./linkedlist/sortList.py) | _O(nlogn)_| _O(1)_| |
| 87 | +|61|[Rotate List](https://leetcode.com/problems/rotate-list/#/description)| [Python](./linkedlist/rotateRight.py) | _O(n)_| _O(1)_| |
| 88 | +|19|[Remove Nth Node From End of List](https://leetcode.com/problems/remove-nth-node-from-end-of-list/#/description)| [Python](./linkedlist/removeNthFromEnd.py) | _O(n)_| _O(1)_| |
| 89 | +|138|[Copy List with Random Pointer](https://leetcode.com/problems/copy-list-with-random-pointer/#/description)| [Python](./linkedlist/copyRandomList.py) | _O(n)_| _O(n)_| |
70 | 90 |
|
71 | 91 |
|
72 | 92 | ## Stacks Easy
|
73 |
| -| # | Title | Solution | Time | Space | Difficulty |Tag| Note| |
74 |
| -|-----|-------| -------- | ---- | ------|------------|---|-----| |
| 93 | +| # | Title | Solution | Time | Space | Video| |
| 94 | +| --- | ----- | -------- | ---- | ----- | ---- | |
75 | 95 | |155|[Min Stack](https://leetcode.com/problems/min-stack/#/description)| [Python](./stack_queue/minStack.py) | _O(1)_| _O(n)_ | Easy | ||
|
76 | 96 | |225|[Implement Stack using Queues](https://leetcode.com/problems/implement-stack-using-queues/#/description)| [Python](./stack_queue/queueStack.py) | push/pop: _O(1)_ top:_O(n)_ | _O(n)_ | Easy | ||
|
77 | 97 | |20|[Valid Parentheses](https://leetcode.com/problems/valid-parentheses/#/description)| [Python](./stack_queue/isValid.py) | _O(n)_| _O(n)_ | Easy | ||
|
78 | 98 | |346|[Moving Average from Data Stream](https://leetcode.com/problems/moving-average-from-data-stream/#/description)| [Python](./stack_queue/movingAverage.py) | _O(1)_| _O(n)_ | Easy | ||
|
79 | 99 |
|
80 | 100 |
|
81 | 101 | ## Tree Easy
|
82 |
| -| # | Title | Solution | Time | Space | Difficulty |Tag| Note| |
83 |
| -|-----|-------| -------- | ---- | ------|------------|---|-----| |
| 102 | +| # | Title | Solution | Time | Space | Video| |
| 103 | +| --- | ----- | -------- | ---- | ----- | ---- | |
84 | 104 | |110|[Balanced Binary Tree](https://leetcode.com/problems/balanced-binary-tree/#/description)| [Python [Yu]](./tree/Yu/110_isBalanced.py) | _O(N)_| _O(h)_ | Easy | ||
|
85 | 105 | |112|[Path Sum](https://leetcode.com/problems/path-sum/#/description)| [Python [Yu]](./tree/Yu/112_hasPathSum.py) | _O(N)_| _O(h)_ | Easy | |[中文讲解](https://www.youtube.com/watch?v=LgtcGjIuE18&feature=youtu.be)|
|
86 | 106 | |100|[Same Tree](https://leetcode.com/problems/same-tree/)| [Python [Yu]](./tree/Yu/100_isSameTree.py) | _O(N)_| _O(1)_ | Easy |||
|
|
102 | 122 |
|
103 | 123 |
|
104 | 124 | ## Tree Medium
|
105 |
| -| # | Title | Solution | Time | Space | Difficulty |Tag| Note| |
106 |
| -|-----|-------| -------- | ---- | ------|------------|---|-----| |
| 125 | +| # | Title | Solution | Time | Space | Video| |
| 126 | +| --- | ----- | -------- | ---- | ----- | ---- | |
107 | 127 | |144|[Binary Tree Preorder Traversal](https://leetcode.com/problems/binary-tree-preorder-traversal/#/description)| [Python [Yu]](./tree/Yu/144.py) | _O(N)_| _O(N)_ | Medium | |[:tv:](https://youtu.be/cHbdPonjYS0)|
|
108 | 128 | |102|[Binary Tree Level Order Traversal](https://leetcode.com/problems/binary-tree-level-order-traversal/#/description)| [Python [Yu]](./tree/Yu/102.py) | _O(N)_| _O(N)_ | Medium | |[:tv:](https://youtu.be/IWiprpdSgzg)|
|
109 | 129 | |107|[Binary Tree Level Order Traversal II](https://leetcode.com/problems/binary-tree-level-order-traversal-ii/#/description)| [Python [Yu]](./tree/Yu/107.py) | _O(N)_| _O(N)_ | Medium | ||
|
|
116 | 136 |
|
117 | 137 |
|
118 | 138 | ## Backtrack Medium
|
119 |
| -| # | Title | Solution | Time | Space | Difficulty |Tag| Note| |
120 |
| -|-----|-------| -------- | ---- | ------|------------|---|-----| |
| 139 | +| # | Title | Solution | Time | Space | Video| |
| 140 | +| --- | ----- | -------- | ---- | ----- | ---- | |
121 | 141 | |78|[Subsets](https://leetcode.com/problems/subsets/#/description)| [Python [Yu]](./backtrack/Yu/78.py) | _O(N*(2^N))_| _O(2^N)_ | Medium | |[:tv:](https://youtu.be/Az3PfUep7gk)|
|
122 | 142 | |90|[Subsets II](https://leetcode.com/problems/subsets-ii/#/description)| [Python [Yu]](./backtrack/Yu/90.py) | _O(N*(2^N))_| _O(2^N)_ | Medium | |[:tv:](https://youtu.be/Az3PfUep7gk)|
|
123 | 143 | |46|[Permutations](https://leetcode.com/problems/permutations/#/description)| [Python [Yu]](./backtrack/Yu/46.py) | _O(N*(N!))_| _O(N!)_ | Medium | |[:tv:](https://www.youtube.com/watch?v=oCGMwvKUQ_I&feature=youtu.be)|
|
|
129 | 149 | |216|[Combination Sum III](https://leetcode.com/problems/combination-sum-iii/#/description)| [Python [Yu]](./backtrack/Yu/216.py) | _O(K * (2^N)_| _O(N)_ | Medium | ||
|
130 | 150 |
|
131 | 151 | ## Greedy Medium
|
132 |
| -| # | Title | Solution | Time | Space | Difficulty | Note| |
133 |
| -|-----|-------| -------- | ---- | ------|------------|-----| |
| 152 | +| # | Title | Solution | Time | Space | Video| |
| 153 | +| --- | ----- | -------- | ---- | ----- | ---- | |
134 | 154 | |452|[Minimum Number of Arrows to Burst Balloons](https://leetcode.com/problems/minimum-number-of-arrows-to-burst-balloons/#/description)| [Python [Yu]](./greedy/452.py) | _O(N)_| _O(1)_ | Medium| |
|
135 | 155 |
|
136 | 156 | ## Dynamic Programming Easy
|
137 |
| -| # | Title | Solution | Time | Space | Difficulty | Note| |
138 |
| -|-----|-------| -------- | ---- | ------|------------|-----| |
| 157 | +| # | Title | Solution | Time | Space | Video| |
| 158 | +| --- | ----- | -------- | ---- | ----- | ---- | |
139 | 159 | |70|[Climbing Stairs](https://leetcode.com/problems/climbing-stairs/#/solutions)| [Python [Yu]](./dp/70.py) | _O(N)_| _O(1)_ | Easy| |
|
140 | 160 | |53|[Maximum Subarray](https://leetcode.com/problems/maximum-subarray/#/description)| [Python [Yu]](./dp/53.py) | _O(N)_| _O(N)_ | Easy|[:tv:](https://youtu.be/4tfhDdgu76E) |
|
141 | 161 | |198|[House Robber](https://leetcode.com/problems/house-robber/#/description)| [Python [Yu]](./dp/198.py) | _O(N)_| _O(N)_ | Easy|[:tv:](https://youtu.be/QSjPkgyxCaQ) |
|
142 | 162 |
|
143 | 163 |
|
144 | 164 |
|
145 | 165 | ## Dynamic Programming Medium
|
146 |
| -| # | Title | Solution | Time | Space | Difficulty | Note| |
147 |
| -|-----|-------| -------- | ---- | ------|------------|-----| |
| 166 | +| # | Title | Solution | Time | Space | Video| |
| 167 | +| --- | ----- | -------- | ---- | ----- | ---- | |
148 | 168 | |64|[Minimum Path Sum](https://leetcode.com/problems/minimum-path-sum/#/submissions/1)| [Python [Yu]](./dp/64.py) | _O(N^2)_| _O(M*N)_ | Medium| [:tv:](https://youtu.be/bEcW6QqgXvM)|
|
149 | 169 | |62|[Unique Paths](https://leetcode.com/problems/unique-paths/#/description)| [Python [Yu]](./dp/62.py) | _O(N^2)_| _O(M*N)_ | Medium| Reference #64|
|
150 | 170 | |55|[Jump Game](https://leetcode.com/problems/jump-game/)| [Python [Yu]](./dp/55.py) | _O(N^2)_| _O(1)_ | Medium| TLE with DP/Use Greedy for O(N) Solution|
|
|
0 commit comments