Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if(ch==5)/*menu to sort list*/
- {
- node *t,q;
- int i,j,n=0;
- t=first;/*first node*/
- while(t!=NULL)
- {
- t=t->next;
- n++;
- }
- for(i=0; i<n; i++)
- {
- for(j=0; j<n-i; i++)
- {
- if(t->next!=NULL){
- if((t->age)>((t->next)->age)){
- q=*t;
- *t=*(t->next);
- *(t->next)=q;}
- }
- }
- }
Add Comment
Please, Sign In to add comment