排序功能中的时间复杂度

问题描述

在python中,我们使用sort函数(例如,如果我们有一个list-a,则使用a.sort()对列表进行排序)。但是如何知道sort函数使用哪种类型的排序(冒泡,选择,插入等)。

解决方法

好吧,.sort python函数使用Timsort算法。您可以在这篇文章中了解更多-> About Python's built in sort() method

相关问答

错误1:Request method ‘DELETE‘ not supported 错误还原:...
错误1:启动docker镜像时报错:Error response from daemon:...
错误1:private field ‘xxx‘ is never assigned 按Alt...
报错如下,通过源不能下载,最后警告pip需升级版本 Requirem...