Write a program to reverse a linked list?

Answer Posted / surendra

suppose p is the head pointer.


r=NULL;
while(p)
{
q=r;
r=p;
p=p->next;
r->next=q;
}
p=r;

Is This Answer Correct ?    16 Yes 7 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are the storage qualifiers?

658


Explain the use of this pointer?

630


What is the iunknown interface?

672


What are the main features of c++?

534


Specify different types of decision control statements?

348






Explain virtual destructor?

662


What is null and void pointer?

584


how to explain our contribution in the project?

3067


Explain this pointer?

574


Is c++ a float?

595


Is linux written in c or c++?

541


What are pointer-to-members? Explain.

620


What does it mean to declare a member function as static?

605


Is c++ primer good for beginners?

579


what is C++ exceptional handling?

618