I have tried to fixed the following sort function for my linked list but unfortunately i can't get it to work. What is happening is that it keep deleting the node that need to be moved but when i add a node to the end then it sort everything except the head of the list. So any help will be greatly appreciated.
this is the struct to let you have and idea of the list: