How to Sort a List in Python(ao.gl) |
How to Sort a List in Python(ao.gl) |
> 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.