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 can you quickly find the number of elements stored in a dynamic array? Why is it difficult to store linked list in an array?

0 Answers  


What is a dangling pointer in c++?

0 Answers  


What is functions syntax in c++?

0 Answers  


Is set c++?

0 Answers  


Are strings immutable in c++?

0 Answers  






Explain the volatile and mutable keywords.

0 Answers  


What is the difference between #import and #include in c++?

0 Answers  


Describe the process of creation and destruction of a derived class object?

0 Answers  


Explain the concept of dynamic allocation of memory?

0 Answers  


What is conditions when using boolean operators?

0 Answers  


Where the memory to the static variables is allocated?

0 Answers  


What do you mean by funtion prototype?

0 Answers  


Categories