qsort switching to insertsort

Eduardo Morras emorrasg at yahoo.es
Sat Nov 26 16:38:34 UTC 2016


On Sat, 26 Nov 2016 06:35:53 -0800
Mehmet Erol Sanliturk <m.e.sanliturk at gmail.com> wrote:


> In quick sort , it is necessary to check worst case and switch to
> another sort method if it is detected .
> When this is not done , end result is stack overflow , etc . , but not
> success .
> Therefore , it is not possible to eliminate an alternative sort
> method .

And restricting the alternative sort for less than 40 elements (or other
number)? It's common implementation to fallback to other sort
algorithm, but doing so without restricting the number of elements can
cause on corner cases, sorting all elements with alternative sort,
which is bad.
 
> 
> Mehmet Erol Sanliturk

---   ---
Eduardo Morras <emorrasg at yahoo.es>


More information about the freebsd-hackers mailing list