This is the mail archive of the egcs@egcs.cygnus.com mailing list for the EGCS project. See the EGCS home page for more information.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: About sorting algorithm in glibc


getegcs@terrorist.math.ntu.edu.tw writes:

|> 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 ...

GNU libc uses merge sort if it can get the needed space, otherwise resorts
to quicksort.  I don't know what Bentley and Tukey is about, but GNU
libc's quicksort contains some optimisations from Sedgewick.

-- 
Andreas Schwab                                      "And now for something
schwab@issan.cs.uni-dortmund.de                      completely different"
schwab@gnu.org