TM> The idea of quicksort is:
TM> In C++, this might look like this:
TM> template
TM> quicksort(Iterator head, Iterator tail)
TM> // we've found them, so let's swap them
TM> swap(*first,*last);
TM> This code isn't tested!! Would somebody please proofread?
TM> The function template takes two arguments of a type (such as a pointer
TM> type and a Standard C++ Library bidirectional iterator type) that can
TM> be dereferenced to an element type that can be assigned and compared:
And swapped! is this done with swap(void *, void *) or another
template? When I have more time I'll experiment with this.
Thanks for the code!
L8r,
bw
... Press any key to continue or any other key to quit
--- Blue Wave/DOS v2.20
---------------
* Origin: River Canyon Rd. BBS Chattanooga, Tn (1:362/627)
|