It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center。
我正在准备性交我需要找出什么是最快的方法来找到一个大值和多个条目的数组?
内置的python排序是最快的还是需要实现其他排序方法?
最佳答案
如果您的数据已经在Python中,那么Python的sort可能是最快的方法它使用的Timsort algorithm在随机数据和部分有序数据上表现良好。
如果您只需要最大的项目,请使用heapq.nlargest。
关于python - 用Python对算法进行排序的最快方法,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/8365923/