📜  python 排序复杂度 - Python 代码示例

📅  最后修改于: 2022-03-11 14:46:56.192000             🧑  作者: Mango

代码示例1
nlog2n. 

As others have mentioned, the built-in sorting algorithm of Python uses a special version of merge sort, called Timsort, which runs in  nlog2n  time.

That’s pretty good; we generally can’t get much better than  nlog2n (with the exception of sorts which are slightly optimized for certain arrangements of data).

You can read more about how Timsort works (it’s pretty cool!) here: