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
What is the difference between a pointer and a link in c ++?
What do you know about near, far and huge pointer?
Which bit wise operator is suitable for putting on a particular bit in a number?
Is dev c++ free?
Why use of template is better than a base class?
What is a memory leak c++?
How static variables and local variablesare similar and dissimilar?
Why do we use templates?
What are vtable and vptr?
Can I learn c++ without learning c?
What is null pointer and void pointer and what is their use?
Is c++ the most powerful language?
Which command properly allocates memory a) char *a=new char[20]; b) char a=new char[20]; c) char a=new char(20.0);
Explain overriding.
What is runtime polymorphism in c++?