문제

x = [1, 4, 7, 65, 23, 57, 12]
>>> sorted(x)
[1, 4, 7, 12, 23, 57, 65]

Just out of curiosity, how does this function work? What is the algorithm that Python uses to sort iterables?

도움이 되었습니까?

해결책

Python used to use Quicksort.

Then, the mighty Tim Peters came along, with a level 20 keyboard and coding chops that were over 9000; and in a magnificent symphony of elegance and brilliance, built Timsort and gifted it to us mere mortals, for our lives would be incomplete without it.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top