About sorting algorithm in glibc

Matthew Kirkwood weejock@ferret.lmh.ox.ac.uk
Wed Mar 31 23:46:00 GMT 1999


On Sat, 27 Mar 1999 getegcs@terrorist.math.ntu.edu.tw wrote:

> Can someone tell me what is the sorting algorithm used for the qsort() 
> in the GNU C library (newest version)?  Does it come from the Bentley
> and Tukey improved (Ninther) variant?  Thanks for any info ...

This is related to egcs development how?

glibc-2.0.x uses quicksort (standard unimproved version) up to 1K elements
(actually, maybe 1Kbytes - don't remembers) and then switches to
mergesort.  I found this out by qsort()ing about 100Mb of integers on a
64Mb machine with only 64Mb swap :(

Matthew.




More information about the Gcc mailing list