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
What is the use of header?
How can you check to see whether a symbol is defined?
Explain what are run-time errors?
What is the difference between exit() and _exit() function?
What is the symbol indicated the c-preprocessor?
When should a type cast be used?
a value that does not change during program execution a) variabe b) argument c) parameter d) none
How many keywords (reserve words) are in c?
Explain the binary height balanced tree?
What is type qualifiers?
What is double pointer in c?
What is enumerated data type in c?
Explain what is the benefit of using an enum rather than a #define constant?
How can I delete a file?
Is it valid to address one element beyond the end of an array?