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
What the advantages of using Unions?
What is the difference between local variable and global variable in c?
Subtract Two Number Without Using Subtraction Operator
What are global variables?
How can a process change an environment variable in its caller?
What is ponter?
When would you use a pointer to a function?
What is the basic structure of c?
What is malloc return c?
What is union and structure in c?
What is a 'null pointer assignment' error? Explain what are bus errors, memory faults, and core dumps?
What is the function of volatile in c language?
What do you mean by invalid pointer arithmetic?
What is extern storage class in c?
What are preprocessor directives in c?