Page 1 of 1

Sorting Algorithm used by PureBasic

Posted: Fri Feb 05, 2010 4:40 pm
by DarkDragon
Hello,

Could you please add to the PB help some informations about the sorting algorithm which is used?
I've heared that its QuickSort (not stable, inplace). And which element is used as pivot?
If its not the middle one: does it check at least if the elements are sorted already?

Re: Sorting Algorithm used by PureBasic

Posted: Fri Feb 05, 2010 4:45 pm
by Demivec
DarkDragon wrote:Could you please add to the PB help some informations about the sorting algorithm which is used?
I've heared that its QuickSort (not stable, inplace). And which element is used as pivot?
If its not the middle one: does it check at least if the elements are sorted already?
PureBasic uses QuickSort (unstable, in-place) for arrays and MergeSort for linked-lists (stable, in-place).