test auth sort - { curr->next=next->next;...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
BOOKS *sort_auth(BOOKS *start) { /*Beginning of funct*/ BOOKS *prev1,*prev2,curr,nxt; curr=start; nxt=curr->next; if (strcmp(curr->author,nxt->author)>0) { start=nxt; curr->next=nxt->next; nxt->next=curr; return start; } prev1=curr; curr=curr->next; nxt=curr->next; while (nxt->next!=NULL) { /*Beginning of while !=NULL*/ if (strcmp(curr->author,nxt->author)>0)
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: { curr->next=next->next; prev1->next=nxt; nxt->next=curr; } prev1=curr; curr=curr->next; nxt=curr->next; } /*End of while !=NULL*/ if (strcmp(curr->author,nxt->author)>0) { curr->next=next->next; prev1->next=nxt; nxt->next=curr; return start; } if (strcmp(curr->author,nxt->author)<0) { return start; } } /*End of funct*/...
View Full Document

This note was uploaded on 10/26/2011 for the course ECE 3331 taught by Professor Staff during the Fall '08 term at University of Houston.

Ask a homework question - tutors are online