TIP: Click on subject to list as thread! ANSI
echo: c_plusplus
to: TIMO FINNIL
from: MATHIEU BOUCHARD
date: 1998-03-26 21:05:00
subject: Sorting linked list

 TF> Help me please, i got a big problem %-)
 TF> How do i (quick)sort linked lists?
The easiest way is to create an array of the same length, put the
pointers to it in an array, sort the pointers, and recreate the list.
it's probably the fastest too.
Inserting an element in a linked list, however, is very fast. what's
not is seeking the insertion point in that list. :-) if you have for
example a text editor and want to insert at line 17567 out of 43142,
use B-Trees (I think that's how they're called).
matju
--- Terminate 4.00/Pro
---------------
* Origin: The Lost Remains Of SatelliteSoft BBS (1:163/215.42)

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