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

write a porgram in c++ that reads an integer and print the biggest digit in the number

1986


Which software is best for programming?

845


Is c++ used anymore?

817


What is c++ stringstream?

836


What is time h in c++?

835






Can I learn c++ without knowing c?

778


What are guid? Why does com need guids?

764


Explain "const" reference arguments in function?

783


How do you master coding?

788


What is general form of pure virtual function? Explain?

707


How to tokenize a string in c++?

769


Write about the role of c++ in the tradeoff of safety vs. Usability?

783


Difference between class and structure.

876


Do vectors start at 0?

748


write asingle linked list which read from two list & the do the following 1 sort the prime & nonprime num (prime should be less tn nonprime) 2 each node has a prime num followd by nonprime 3 add a new node into its sutable plce 4 erase the most three duplicated non prime num 5 find the least duplicated prime num

2388