revised patch to qsort

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

revised patch to qsort

djamel anonymous
hello all, after my last mail i made a search on this mailing list i
discovered that there has already been a proposed version by wolfgang glas
dated 8 Jun 2004.the reason for which the sugestion was rejected
was because the standard requires omparison function be passed only pointers
from the original array.
i revised my own version to call the comparison function with arguments only
from the original array.
by benchmarking on an array of 2 millions 32 bits unsigned integers on
athlon xp 1700+ i found the following results:
random aray:
original qsort 1.93 seconds
modified qsort 1.60 secons
reverse sorted aray:
original qsort 1.32 seconds
modified qsort 0.94 secons
i have attached only the modified version of the file msort.c
best regards.

_________________________________________________________________
MSN Messenger : appels gratuits de PC à PC !
http://www.msn.fr/newhotmail/Default.asp?Ath=f

new_msort2.c (5K) Download Attachment