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

How would you stop a class from class from being derived or inherited?The constructer should not be Private,as object instantiation should be allowed.

15 Answers   Satyam,


How do pointers work?

0 Answers  


Explain what data encapsulation is in c++?

0 Answers  


which one is equivalent to multiplying by 2:Left shifting a number by 1 or Left shifting an unsigned int or char by 1?

0 Answers  


List the issue that the auto_ptr object handles?

0 Answers  






What are the different types of comments allowed in c++?

0 Answers  


What are the advantages of prototyping?

0 Answers  


Describe functional overloading?

6 Answers   HP,


Write the program for fibonacci in c++?

20 Answers   TATA, Wipro,


What is the difference between the parameter to a template and the parameter to a function?

0 Answers  


What is the Difference between "C structure" and "C++ structure"?

12 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  


Categories