Java7, Java mergesort TimSort ( python dev , cpython first) .
While this is not O (1), sorting an already sorted or partially sorted list with TimSort is quite efficient than sorting a completely random dataset (for a later time, there is no way to be more efficient than O(n log n)comparing sorting, which is not true for non-random data).
source
share