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 is searching? Explain linear and binary search.
Why c++ is faster than java?
What are the various arithmetic operators in c++?
What are the 2 main types of data structures?
Do you know what are pure virtual functions?
an operation between an integer and real always yeilds a) integer result b) real result c) float result
Why c++ is called oop?
What does it mean to declare a destructor as static?
What is constructor c++?
what are the decision making statements in C++? Explain if statement with an example?
What are the advantage of using register variables?
What is c++ runtime?
Define pure virtual function?
Where Malloc(), Calloc(), and realloc() does get memory?
Write about an iterator class?