Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in Python by (16.4k points)
I'm attempting to disclose to somebody why they should use Python's built-in sorted() function as opposed to moving their own, and I understood I have no clue about what algorithm it uses and we're talking about Python 2.7

1 Answer

0 votes
by (26.4k points)
edited by

Python actually uses an algorithm, so called Timsort.

Timsort is actually a hybrid sorting algorithm, gotten from merge sort and insertion sort, intended to perform well on numerous sorts of true information. It was created by Tim Peters in 2002 for use in the Python language. The algorithm also discovers subsets of the information that are now requested, and utilizes the subsets to sort the information all the more proficiently. This is finished by merging a distinguished subset, called a run, with existing runs until specific rules are satisfied. Since the version of 2.3, Timsort was considered as the python's standard sorting algorithm. It is currently likewise used to sort exhibits in Java SE 7, and on the Android platform.

Looking for a good python tutorial course? Join the python certification course and get certified.

For more details, do check out the below video tutorial...

Related questions

0 votes
4 answers
0 votes
1 answer
asked Nov 13, 2019 in Java by Nigam (4k points)
0 votes
1 answer
0 votes
4 answers
asked Apr 18, 2021 in Python by laddulakshana (16.4k points)
0 votes
4 answers

Browse Categories

...