TF> Help me please, i got a big problem %-)
TF> How do i (quick)sort linked lists?
You don't, really.
I would discard the old list while performing a median
insert sort in a new one. It will still be slow because you
have to walk the list all the time, unless you also maintian
a list of pointers. You COULD just walk the list and create
an array of list member pointers, and then sort that array
and relink the list from the sorted array. That would most
likely be the fastest method available, now that I think of
it, and would require the least code, also.
> ] We learn from our mistakes. I'm in the Accelerated Program!!
---
---------------
* Origin: *YOPS ]I[* 8.4 GIG * RA/FD/FE * Milwaukee, WI (1:154/750)
|