can i know the source code for reversing a linked list with
out using a temporary variable?
Answer Posted / ruchi
void reverse()
{
nptr p;
int i=0;
p=start;
while(p->next!=NULL)
{
p=p->next;
i=i+1;
}
i++;
while(i)
{
printf("%d\n",p->num);
p=p->prev;
i--;
}
}
| Is This Answer Correct ? | 1 Yes | 1 No |
Post New Answer View All Answers
What is an lvalue?
a program that can input number of records and can view it again the record
Explain can static variables be declared in a header file?
write a program that will open the file, count the number of occurences of each word in the the complete works of shakespeare. You will then tabulate this information in another file.
Here is a good puzzle: how do you write a program which produces its own source code as output?
What does *p++ do? What does it point to?
When would you use a pointer to a function?
What is the value of a[3] if integer a[] = {5,4,3,2,1}?
What are pointers? What are different types of pointers?
Explain what is gets() function?
What are the advantages of c language?
Explain what is the benefit of using an enum rather than a #define constant?
When is a “switch” statement preferable over an “if” statement?
What does c mean in basketball?
What is static volatile in c?