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

Tell me difference between constant pointer and pointer to a constant.

0 Answers   Honeywell, Zomato,


Write a C++ Program to Generate Random Numbers between 0 and 100

1 Answers  


Have you used MSVC? What do you think of it?

2 Answers   Google,


Which one between if-else and switch is more efficient?

0 Answers  


How do you import payscale data from non SAP to SAP?is it through LSMW or any other way is there?

0 Answers  






iam a fresher to Qt(GUI a c++ based framework software). i need to develop the basic applications on designer by drag and dropping mechanism...so pls send me the procedure to design applications?

1 Answers  


Declare a class vehicle and make it an abstract data type.

0 Answers  


Write about the members that a derived class can add?

0 Answers  


If a base class is an adt, and it has three pure virtual functions, how many of these functions must be overridden in its derived classes?

0 Answers  


What is class and structure in c++?

0 Answers  


What is a buffer c++?

0 Answers  


Which ide is best for c++?

0 Answers  


Categories