TIP: Click on subject to list as thread! ANSI
echo: c_plusplus
to: THOMAS MAEDER
from: BRIAN WOOD
date: 1998-01-23 15:35:00
subject: sort algorithm

 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)

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