Fastest way to sort in Python

后端 未结 9 2115
太阳男子
太阳男子 2021-02-13 02:56

What is the fastest way to sort an array of whole integers bigger than 0 and less than 100000 in Python? But not using the built in functions like sort.

Im looking at th

9条回答
  •  太阳男子
    2021-02-13 03:05

    I might be a little late to the show, but there's an interesting article that compares different sorts at https://www.linkedin.com/pulse/sorting-efficiently-python-lakshmi-prakash

    One of the main takeaways is that while the default sort does great we can do a little better with a compiled version of quicksort. This requires the Numba package.

    Here's a link to the Github repo: https://github.com/lprakash/Sorting-Algorithms/blob/master/sorts.ipynb

提交回复
热议问题