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
What is n in c?
What does the characters “r” and “w” mean when writing programs that will make use of files?
Is c procedural or functional?
Find MAXIMUM of three distinct integers using a single C statement
In C programming, how do you insert quote characters (‘ and “) into the output screen?
Explain the Difference between the New and Malloc keyword.
Explain how do you print only part of a string?
How can this be legal c?
What are the advantages of using Unions?
#include main() { char s[] = "Bouquets and Brickbats"; printf(" %c, ",*(&s[2])); printf("%s, ",s+5); printf(" %s",s); printf(" %c",*(s+2)); }
Can the size of an array be declared at runtime?
What does %d do?
What is a constant?
What is the difference between strcpy() and memcpy() function in c programming?
How is pointer initialized in c?