Write a program to reverse a linked list?
Answer Posted / bipin pandey
node *reverse(node *first)
{
node *cur,*temp;
cur=NULL;
while(first!=NULL)
{temp=first;
first=first->link;
temp->link=cur;
cur=temp;
}
return cur;
}
Is This Answer Correct ? | 5 Yes | 4 No |
Post New Answer View All Answers
What are advantages of c++?
What are member functions used in c++?
What c++ is used for?
Why is c++ still used?
Write a function to find the nth item from the end of a linked list in a single pass.
What are features of c++?
Explain Memory Allocation in C/C++ ?
What is class invariant in c++?
What do you mean by function overriding & function overloading in c++?
What is the best ide for c++?
What is heap sort in c++?
Should a constructor be public or private?
How do I use arrays in c++?
What do you understand by a pure virtual member function?
Can a program run without main function?