How can i sort my LinkList?

Posted by user1054081 on Stack Overflow See other posts from Stack Overflow or by user1054081
Published on 2011-11-19T17:45:27Z Indexed on 2011/11/19 17:50 UTC
Read the original article Hit count: 252

Filed under:
**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;
                    }
                }   
            }** 

© Stack Overflow or respective owner

Related posts about c++