How can i sort my LinkList?
- by user1054081
**node *pre;
node *curr;
//int curr_roll=atoi(curr->rollnumber);
node *temp_node; // store temporary data value
for( pre = head ; pre!=NULL ; pre = pre->next )
{
for( curr = pre->next ; curr!=NULL ; curr = curr->next )
{
if(atoi(pre->rollnumber)>atoi(curr->rollnumber))
{
temp_node=pre;
pre=curr;
curr=temp_node;
}
}
}**