Reversing Linked List

How to reverse a linked list using only one pointer?

Questions by sharan327   answers by sharan327

Showing Answers 1 - 3 of 3 Answers

jjoshi

  • Oct 9th, 2009
 

void revshow()
{
struct node *p;
int temp[100],count=0,i;
p=head;
for(i=0;p!=NULL;i++,p=p->next)
temp[i]=p->num;
for(i=i-1,p=head;p!=NULL;i--,p=p->next)
p->num=temp[i];
}

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions