[Tutor] Sorting algorithm?

Sean 'Shaleh' Perry shaleh@valinux.com
Wed, 04 Apr 2001 13:41:30 -0700 (PDT)


On 04-Apr-2001 VanL wrote:
> 
> What sorting algorithm is used to sort lists?
> 
> given
>>>> list = ['base', 'ball', 'mound', 'bat', 'glove', 'batter']
>>>> list.sort()
>>>> print list
> ['ball', 'base', 'bat', 'batter', 'glove', 'mound']
> 
> What happens behind the scenes?  Quicksort, a la Perl? or some other
> algorithm, possibly depending on the size of n?

In the python source, look at Objects/listobject.c.