in reply to Re: sort function and parity of the permutation.
in thread sort function and parity of the permutation.

As Perl uses quicksort as its sorting algorithm, and that sorting algorithm swaps elements across large distances,
Oh, please, ditch your 5.6, and enter the 21st century. ;-).

As of 5.8, Perl uses an implementation of mergesort as its default sorting algorithm.

  • Comment on Re^2: sort function and parity of the permutation.

Replies are listed 'Best First'.
Re^3: sort function and parity of the permutation.
by Anonymous Monk on Feb 14, 2011 at 10:26 UTC
    sort
    use sort 'stable'; # guarantee stability use sort '_quicksort'; # use a quicksort algorithm use sort '_mergesort'; # use a mergesort algorithm use sort 'defaults'; # revert to default behavior no sort 'stable'; # stability not important use sort '_qsort'; # alias for quicksort