sorting link list from small to big number

iam already sitting 5 hours to understand how to make it without any sucsses
can someone pls help me
if i have link list like : 11->3->4->55
after the function call it will be
3->4->11-55

1
2
3
4
5
6
7
8
9
10
11
Node* search=head;
Node second =search->next;
 while(search !=Null){
if(seach->data> second ->data){
temp=search;
search=second;
second=search
}
else{
search=search->next;
second=second->next;


how to continue iam having alot of problem with it.

its like
11>3? yes
so now
3-11-4-55??
cant fully understand please help
Topic archived. No new replies allowed.