How many pointers are required to reverse a link list?
Answer Posted / vivek
using 2 pointer:
void reverse(node* head_in_out)
{
if(head_in_out)
{
node* aCurr = head_in_out;
node* aNext = NULL;
while (aCurr)
{
head_in_out = aCurr->next;
aCurr->next = aNext;
aNext = aCurr;
aCurr = head_in_out;
}
}
}
| Is This Answer Correct ? | 1 Yes | 2 No |
Post New Answer View All Answers
What are the steps in the development cycle?
What is virtual base class?
Explain the use of this pointer?
How do I get good at c++ programming?
What is the use of turbo c++?
Explain the different access specifiers for the class member in c++.
What are the general quetions are in DEna bank manager IT/System interviews?
Explain function overloading
How a pointer differs from a reference?
Is map thread safe c++?
Explain Text Manipulation Routines?
How does the copy constructor differ from the assignment operator (=)?
Is c the same as c++?
How does list r; differs from list r();?
Draw a flow chart and write a program for the difference between the sum of elements with odd and even numbers. Two dimensional array.