I am trying to sort a linked list alphabetically as the values come in, but it is totally not working, when I do the print out it is not sorting them at all, here is what I am doing:
<code>
if(head == NULL){/*nothing in the list*/
head = File;
end = head;
head->prev = NULL;
head->next = NULL;
}
else{/*there is something in the list*/
temp1 = end;
do{
if((strcmp(File->filename, temp1->filename)) > 0){
File->prev = temp1->prev;
temp1->prev = File;
File->next = temp1;

}
}while((temp1= temp1->next) != NULL);
</code>
File is the link that I am trying to enter into the list. and head and end are two global pointers