The purpose of this repo is to record my learning progress of C++, Data Structure and Algorithm.
Here are my codes. Feel free to contact me.
| # | Title | Difficulty | Solution | Time Efficiency | Space Efficiency | Note |
|---|---|---|---|---|---|---|
| 1 | Two Sum | Easy | two-sum.cpp | O(n) (Average) | O(n) | unordered_map |
| 2 | Add Two Numbers | Medium | add-two-numbers.cpp | max{O(n), O(m)}, n = size of the first linked list, m = size of the second linked list | O(n) (solution requirement) | |
| 209 | Minimum Size Subarray Sum | Medium | minimum-size-subarray-sum.cpp | O(n) | O(1) | |
| 215 | Kth Largest Element in an Array | Medium | kth-largest-element-in-an-array.cpp | O(nlogn) | O(1) | |
| 322 | Coin Change | Medium | coin-change.cpp | O(Mn), M is the value of target amount needs to be changed, n is the size of the coins array | O(n), n is the size of the coins array | dp |
| 977 | Squares of a Sorted Array | Easy | squares-of-a-sorted-array.cpp | O(n) | O(1), ignoring the return array space | two pointers |