problem
solution
option 1 - insert sort
1 | class Solution { |
option 2 - merge sort
1 | class Solution { |
analysis
- option 1 - insert sort
- time complexity
O(n^2)
- space complexity
O(1)
- time complexity
- option 2 - merge sort
- time complexity
O(n)
- space complexity
O(n)
- time complexity