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)
|