Sorting Double Linked List in place

Richard Harter rh at smds.UUCP
Sat Nov 10 18:46:22 AEST 1990


In article <1930 at necisa.ho.necisa.oz>, boyd at necisa.ho.necisa.oz (Boyd Roberts) writes:
> In article <1990Nov7.160701.5838 at bkj386.uucp> anton at analsyn.UUCP (PUT YOUR NAME HERE) writes:
> >I'm looking for a routine to sort a double linked list in place, 
> >given the head of the list and a compare function for the elements 
> >(sort of like qsort).

> What about a bubble sort?

Masochistic, aren't we. :-)

If the man wants qsort, use it.  (Complaints about the inferiority of
qsort to mergesort may be filed with the Ministry of Love, room 101.)
If one has a qsort routine the modifications to use doubly linked lists
instead of array indices are pretty simple.

-- 
Richard Harter, Software Maintenance and Development Systems, Inc.
Net address: jjmhome!smds!rh Phone: 508-369-7398 
US Mail: SMDS Inc., PO Box 555, Concord MA 01742
This sentence no verb.  This sentence short.  This signature done.



More information about the Comp.lang.c mailing list