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 are the applications of c language?
What are the different types of data structures in c?
What is use of pointer?
what are the advantages of a macro over a function?
Is there a way to compare two structure variables?
What would be an example of a structure analogous to structure c?
write a sorting prgm to sort 50 nos and sum them and also remove all the occurrences of 15 and print it?
How can I generate floating-point random numbers?
What is C language ?
What do you mean by keywords in c?
Write a code to remove duplicates in a string.
Are the expressions * ptr ++ and ++ * ptr same?
What is array in c with example?
Can variables be declared anywhere in c?
What is a program flowchart and explain how does it help in writing a program?