how to do in place reversal of a linked list(singly or
doubly)?
Answer Posted / ashish gupta
rev()
{
struct node *a1,*a2,*a3;
if(start->next==NULL) /*Only one element exists*/
return;
a1=start;
a2=a1->next;
a3=a2->next;
a1->next=NULL;
a2->next=a1;
while(a3!=NULL)
{
a1=a2;
a2=a3;
a3=a3->next;
a2->next=a1;
}
start=a2;
}
Is This Answer Correct ? | 2 Yes | 0 No |
Post New Answer View All Answers
What is c++ used for today?
Difference between pass by reference and pass by value?
What is the value of uninitialized variable in c?
The postoder traversal is 7,14,3,55,22,5,17 Then ur Inorder traversal is??? please help me on this
Why static is used in c?
What is structure in c language?
How can I swap two values without using a temporary?
The difference between printf and fprintf is ?
What is chain pointer in c?
Explain what are global variables and explain how do you declare them?
How can I remove the trailing spaces from a string?
What are the application of void data type in c?
Hai,I have done with my bachelor of commerce and planing to ms,please suggest me how to convince vo for shifting from commerce to computers. Visa on 8 DEC 2014 Npu university
What header files do I need in order to define the standard library functions I use?
What is structure of c program?