TIP: Click on subject to list as thread! ANSI
echo: c_plusplus
to: MATHIEU BOUCHARD
from: FLORIAN GAMPER
date: 1998-03-23 14:38:00
subject: Re: Sort Algorithm

Am 20.03.98 schrieb Mathieu Bouchard in C_PLUSPLUS ueber Sort Algorithm :
DN>>> Note that Hoare's algorithm is the one used by the qsort() subroutine
DN>>> of the Standard C Library.
MB>  JdBP> Note that it is wrong to assume this.  (-:
MB>
MB>  JdBP> The C Standard says *nothing* about which algorithm qsort() may
MB> use.  JdBP> It merely
MB>  JdBP> requires that it sort the elements of the array.  A C
MB> implementation  JdBP> could use
MB>  JdBP> Bubble sort and still remain conforming.
MB>
MB> Still, i think the canonical implementation of qsort() is made using
MB> the QuickerSort algorithm.
MB>
MB> BTW, would someone point out to me the difference between the QuickSort
MB> and the QuickerSort ?
I think we are talking about "Quicksort" and "Clever Quicksort"
The difference is the method how to find the pivot element.
Quicksort is "normaly" taking the last Element of the Array.
while Clever Quicksort takes the first, the last and an element in
the middle of the array and of these the middle one (sorry for my bad  
english hope you get that).
Another improvement of "quicksort" is, to implement "insertion sort" for  
small splits of the array and to make the algorythm iterative by using  
Stacks.
In this case you can save about 30% of time to sort an array
Florian Gamper
--- CrossPoint v3.11 R
---------------
* Origin: To the stars, and beyond ... To infinity (2:244/1220.9)

SOURCE: echomail via exec-pc

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.