how to do in place reversal of a linked list(singly or
doubly)?
Answer Posted / divakar & venkatesh
int reverse()
{
node *r,*s,*q;
s=NULL;
q=p;
while(q!=NULL)
{
r=q;
q=q->link;
r->link=s;
s=r;
}
p=r;
return;
}
this is reverse fun for single linked list.
Is This Answer Correct ? | 7 Yes | 4 No |
Post New Answer View All Answers
How are variables declared in c?
how to count no of words,characters,lines in a paragraph.
What are the differences between new and malloc in C?
How to write a program for machine which is connected with server for that server automatically wants to catch the time for user of that machine?
What is wrong with this statement? Myname = 'robin';
Device an algorithm for weiler-atherton polygon clipping, where the clipping window can be any specified polygon
Explain Function Pointer?
can we change the default calling convention in c if yes than how.........?
explain what is a newline escape sequence?
What is a 'null pointer assignment' error? Explain what are bus errors, memory faults, and core dumps?
How to find a missed value, if you want to store 100 values in a 99 sized array?
How can I manipulate individual bits?
Why & is used in c?
What is the sizeof () operator?
Can a pointer point to null?