4 ms·
What is the time complexity? O(n log n) most probably. And what actual sort does it use? Quick sort or merge sort or any other?
by babu_bhaiya 6y ago
What is the time complexity?
O(n log n) most probably.
And what actual sort does it use? Quick sort or merge sort or any other?
- dalke 6y agohttps://en.wikipedia.org/wiki/Timsort https://en.wikipedia.org/wiki/Timsort > In the worst case, Timsort takes O(n logn) comparisons to sort an array of n elements. In the best case, which occurs when the input is already sorted, it runs in linear time, meaning that it is an adaptive sorting algorithm.