struct node *reverse(struct node *start) { struct node *previous, *ptr, *next; previous = NULL; ptr = start; while(ptr!=NULL) { next=ptr->link; ptr->link=previous; previous=ptr; ptr=next; } start=previous; return start; }
Your email address will not be published. Required fields are marked *
Post Comment
Δ
This site uses Akismet to reduce spam. Learn how your comment data is processed.