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

If I is an integer variable, which is faster ++i or i++?

0 Answers  


What do you mean by Stack unwinding?

1 Answers  


How are pointers type-cast?

0 Answers   iNautix,


What are the unique features of C++.

0 Answers  


Write down the equivalent pointer expression for referring the same element a[i][j][k][l]?

0 Answers  






How to construct virtual constructor

6 Answers   Symphony, CIStems Software,


Write about an iterator class?

0 Answers  


What is the difference between a copy constructor and an overloaded assignment operator?

4 Answers   Wipro, Citrix, Microsoft, Belzabar,


What are the advantages of using const reference arguments in a function?

0 Answers  


How are virtual functions implemented in c++?

0 Answers  


What is the word you will use when defining a function in base class to allow this function to be a polimorphic function?

0 Answers  


What is boyce codd normal form in c++?

0 Answers  






Categories