IBM Interview Question

reverse a linked list

Interview Answers

Anonymous

Apr 18, 2011

wrote the program to do the same

Anonymous

May 15, 2011

*tmp,*temp=start,*t; while(temp->next!=NULL) { tmp=temp->next; if(temp==start) temp->next=NULL; else temp->next=t; t=temp; temp=tmp; } temp=start;

Anonymous

May 15, 2011

*tmp,*temp=start,*t; while(temp->next!=NULL) { tmp=temp->next; if(temp==start) temp->next=NULL; else temp->next=t; t=temp; temp=tmp; } start=temp;