problem
solution
option 1 - vector
1 | /** |
option 2 - heap
1 |
|
option 3 - merge sort
1 | class Solution { |
analysis
- option 1
- time complexity
O(nlogn)
- space complexity
O(n)
- time complexity
- option 2 - heap
- time complexity
O(n)
- space complexity
O(n)
- time complexity
- option 3
- time complexity
O(nlogn)
- space complexity
O(1)
- time complexity