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


Please Help Members By Posting Answers For Below Questions

What is merge sort in c?

655


What does == mean in texting?

681


What functions are in conio h?

669


How can I read and write comma-delimited text?

627


If the size of int data type is two bytes, what is the range of signed int data type?

601






How do you view the path?

675


Explain how do you list files in a directory?

626


Can a pointer be null?

572


Explain what does the function toupper() do?

642


What are the types of c language?

566


What is meant by inheritance?

644


Why isnt any of this standardized in c?

645


Create a structure to specify data on students given below: Roll number, Name, Department, Course, Year of joining Assume that there are not more than 450 students in the college. 1.write a function to print names of all students who joined in a particular year 2.write a function to print the data of a student whose roll number is given

2530


What is logical error?

610


Why is c so powerful?

695