can i know the source code for reversing a linked list with
out using a temporary variable?
Answer Posted / abdur rab
struct node* reverse ( struct node* head )
{
struct node* temp;
if ( NULL == head -> next ) temp = head;
else {
temp = reverse ( head -> next );
head -> next -> next = head;
head -> next = NULL;
}
return ( temp );
}
| Is This Answer Correct ? | 0 Yes | 3 No |
Post New Answer View All Answers
Which header file should you include if you are to develop a function which can accept variable number of arguments?
Why should I use standard library functions instead of writing my own?
Why calloc is better than malloc?
What are the back slash character constants or escape sequence charactersavailable in c?
Explain the difference between exit() and _exit() function?
What is a structure and why it is used?
Once I have used freopen, how can I get the original stdout (or stdin) back?
What is equivalent to ++i+++j?
Explain how do you print only part of a string?
What is main () in c?
Describe how arrays can be passed to a user defined function
Do pointers need to be initialized?
What is enumerated data type in c?
The statement, int(*x[]) () what does in indicate?
What is pointer & why it is used?