make a middle node of doubly linklist to the top of the list

Answer Posted / hussein

middle->prev->next = middle->next;
middle->next->prev = middle->prev;

// Now make the middle as head.
middle->prev = NULL;
middle->next = head;
head->prev = middle;
head = middle;

Is This Answer Correct ?    2 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are the five basic elements of a c++ program?

585


Explain the concept of dynamic allocation of memory?

619


What's the order in which the objects in an array are destructed?

862


What is microsoft c++ redistributable 2013?

578


What is the role of static keyword for a class member variable?

631






Can you Mention some Application of C/C++?

628


What's the order in which the local objects are destructed?

842


Explain what is oop?

621


Describe delete operator?

625


explain the reference variable in c++?

580


Why is standard template library used?

586


What kind of problems can be solved by a namespace?

594


Explain pass by value and pass by reference.

598


Why c++ does not have finally?

595


What is the use of c++ programming language in real life?

569