int set = 0; > struct node * Rec_Reverse(struct node *p, struct node *q) > { > > static struct node *r; > if(q->next!=NULL) > Rec_Reverse(p->next,q->next); > if(set == 0) > {r=q; > set++; > } > q->next = p; > p->next=NULL; > return r; > } > > This method has to be invoked as > list = Rec_Reverse(list, list->next); > > The pointer to the reversed list is 'r'. > > -- >
Regards, Vanathi -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.