Sun. Sep. 12, 2004 10:35 AM PT
Instead of sorting a list, specially, yours is a Single Linked List, then I
will suggest that you insert elements in the list in Sorted. Means, keep
your list in order while you insert an element, then Binary search will help
you to find a particular element. If you want me to give an algo. How to
insert elements in Order, pl. let me know.
Good Luck!
"Peter Schmitz" <Pe**********@discussions.microsoft.com> wrote in message
news:E0**********************************@microsof t.com...
Hi,
in my application, I defined a linked list just as follows:
typedef struct _MYLIST{
int myval;
void *next;
}MYLIST;
MYLIST head;
So, the problem is the following: the value 'myval' located in each item
of a filled linked list contains a specific value - but not in the correct
order. so, what's the fastest way to sort the items in the list ascending
by their values in 'myval'.
How can this be done?
thanks a lot
Peter