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






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

Answer / 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




More C++ General Interview Questions

Are there interfaces in c++?

0 Answers  


What is a constructor initializer list and when we use constructor initializer list?

3 Answers   TCS, Soft Info,


Why c++ is faster than java?

0 Answers  


if int1 has the value 12, int has the value 18, and int3 has the value 21, what is the result: int1 < int2 && int2 < int 3

3 Answers  


What is abstraction in c++?

0 Answers  






What is the use of default constructor?

0 Answers  


simple c++ program for "abcde123ba" convert "ab321edcba" with out using string

5 Answers  


How to avoid a class from instantiation?

8 Answers   Symphony,


What is ios flag in c++?

0 Answers  


How do I get good at c++ programming?

0 Answers  


What c++ library is string in?

0 Answers  


What is setiosflags c++?

0 Answers  






Categories