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 ca high or low level language?

580


the first character in the variable name must be an a) special symbol b) number c) alphabet

599


When should I use unitbuf flag?

582


What is a type library?

682


Which is the best c++ compiler for beginners?

554






What does I ++ mean in c++?

579


Explain the scope of resolution operator.

623


Why was c++ created?

542


How a modifier is similar to mutator?

626


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

614


What is the role of copy constructor in copying of thrown objects?

589


Is it possible to write a c++ template to check for a function's existence?

572


What are register variables?

641


What are the differences between java and c++?

528


What operators can you overload in c++?

592