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 malloc() and calloc() function in c language?
What are pointers in C? Give an example where to illustrate their significance.
any C program contains only one function, it must be a) void () b) main () c) message () d) abc ()
When reallocating memory if any other pointers point into the same piece of memory do you have to readjust these other pointers or do they get readjusted automatically?
What does the && operator do in a program code?
I need a help with a program: Write a C program that uses data input in determining the whole of points A and a whole of circles B. Find two points in A so that the line which passes through them, cut through the maximum number of circles.
What is the modulus operator?
Why structure is used in c?
why arguments can generally be passed to functions a) sending the values of the arguments b) sending the addresses of the arguments c) a & b d) none of the above
How the c program is executed?
What is the purpose of void in c?
What are the types of c language?
Explain what math functions are available for integers? For floating point?
What is the difference between typedef and #define?
Is a pointer a kind of array?