Path: utzoo!attcan!uunet!snorkelwacker!think!zaphod.mps.ohio-state.edu!wuarchive!udel!udccvax1!pricked From: pricked@vax1.acs.udel.EDU (Jenn-Ming Yang) Newsgroups: comp.lang.c Subject: Generic sort routine for linked lists Message-ID: <5853@udccvax1.acs.udel.EDU> Date: 12 Mar 90 16:26:29 GMT Reply-To: pricked@vax1.acs.udel.EDU (Jenn-Ming Yang) Organization: University of Delaware Lines: 16 I am in need of a generic sort routine written in C for linked lists(of structs) (single links, no back links) I need it to me the following requirements: 1)sort in place, or place ptrs in an array(and keep the linked list intact!) 2)be able to sort on ANY field(even dynamically allocated) in the struct. 3)be able to sort in ascending OR descending 4)take key value into account such that 2 structs with equal key values will retain the same order that they have before the sort. if anyone has such a program, then send me e-mail. thanks -- pricked@vax1.acs.udel.edu (or pricked@192.5.57.1, pricked@192.5.57.129)