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 the difference between a string copy (strcpy) and a memory copy (memcpy)? When should each be used?
What does c value mean?
Can we assign string to char pointer?
what are non standard function in c
Write a program to generate random numbers in c?
Which is better oop or procedural?
Why is this loop always executing once?
How can I automatically locate a programs configuration files in the same directory as the executable?
What is the use of function in c?
Explain what header files do I need in order to define the standard library functions I use?
pierrot's divisor program using c or c++ code
Explain how can I convert a string to a number?
hi any body pls give me company name interview conduct "c" language only
Describe wild pointers in c?
What is the difference between functions abs() and fabs()?