Write a program to reverse a linked list?

Answer Posted / jithin

reverse(Node * previous, Node * Current)
{
start = current;
if(current !=null)
{
reverse(current, current->next);
current->next = previous;
}

}

Is This Answer Correct ?    2 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What does 7/9*9 equal ? a) 1 b) 0.08642 c) 0

760


When there is a global variable and local variable with the same name, how will you access the global variable?

877


What are files in c++?

792


Why do we need c++?

792


What is type of 'this' pointer? Explain when it is get created?

788


What does the ios::ate argument do?

919


What is tellg () in c++?

1039


Explain how the virtual base class is different from the conventional base classes of the opps.

910


Explain terminate() and unexpected() function?

845


Please explain the reference variable in c++?

817


What are the extraction and insertion operators in c++?

779


What is :: operator in c++?

804


How does code-bloating occur in c++?

950


What is the difference between new() and malloc()?

1229


What are pointer-to-members in C++? Give their syntax.

874