can i know the source code for reversing a linked list with
out using a temporary variable?
Answer Posted / dinakaran gct
#include<stdio.h>
struct node *head;
void main();
{
//consider head is the first node
reverse(head);
//here print the reversed link list ...thank you;
}
reverse(struct node *cur)
{
if(cur->next==NULL)
reveres(cur->next)
else{temp=head=cur;}
temp->next=cur;
temp=temp->next;
temp->next=NULL;
}
| Is This Answer Correct ? | 2 Yes | 1 No |
Post New Answer View All Answers
a character or group of characters that defines a register,or a part of storage a) memory b) byte c) address d) linear list
What is fflush() function?
Write a program to print fibonacci series without using recursion?
What are the 32 keywords in c?
can we have joblib in a proc ?
What is header file in c?
Explain what does the characters 'r' and 'w' mean when writing programs that will make use of files?
Why does everyone say not to use scanf? What should I use instead?
Can the “if” function be used in comparing strings?
the constant value in the case label is followed by a a) semicolon b) colon c) braces d) none of the above
any limit on the number of functions that might be present in a C program a) max 35 functions b) max 50 functions c) no limit d) none of the above
When should we use pointers in a c program?
how to solve "unable to open stdio.h and conio.h header files in windows 7 by using Dos-box software
Explain the use of 'auto' keyword in c programming?
What is #line used for?