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
Why do we need function?
What's the "software peter principle”?
Where are setjmp and longjmp used in c++?
Explain the different access specifiers for the class member in c++.
Explain how to initialize a const member data.
How did c++ start?
How would you implement a substr() function that extracts a sub string from a given string?
What is ifstream c++?
Distinguish between a # include and #define.
Write a Program for dynamically intialize a 2 dimentional array. Eg:5x20, accept strings and check for vowels and display the no.finally free the space allocated .
What is the difference between c++ and turbo c++?
When do you call copy constructors?
List the merits and demerits of declaring a nested class in C++?
How would you find out if a linked-list is a cycle or not?
Describe private, protected and public – the differences and give examples.