problem
給定一個整數陣列,找出最遞增子序列。
solution
option 1 - dp
1 | class Solution { |
option 2 - *Binary Search
更多可以參考patience sorting
1 | class Solution { |
analysis
- option 1 - dp
- time complexity
O(n^2)
- space complexity
O(1)
- time complexity
- option 2 - binary search
- time complexity
O(nlogn)
- sapcency complexity
O(1)
- time complexity