make a middle node of doubly linklist to the top of the list
Answer Posted / 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 View All Answers
How to implement is-a and has-a class relationships?
What sorting algorithm does c++ use?
How to access a variable of the structure?
What is a map in c++?
In a function declaration what does extern means?
What is main function in c++ with example?
Difference between overloading vs. Overriding
Is c++ the most powerful language?
Explain abstraction.
Why are pointers not used in c++?
What are libraries in c++?
What is :: operator in c++?
What is null pointer and void pointer and what is their use?
Explain how functions are classified in C++ ?
What is lambda in c++?