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


Please Help Members By Posting Answers For Below Questions

Is c++ the most powerful language?

558


Difference between a homogeneous and a heterogeneous container

652


What is namespace & why it is used in c++?

600


Why c++ is not a pure oop language?

549


What is the real purpose of class – to export data?

607






Can union be self referenced?

567


What jobs can you get with a c++ certification?

575


What is type of 'this' pointer?

588


List down the guideline that should be followed while using friend function.

642


How do you generate a random number in c++?

597


What is buffer and example?

517


Define pointers?

597


What is a local reference?

664


Does c++ vector allocate memory?

523


What is the this pointer?

624