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


Please Help Members By Posting Answers For Below Questions

What are smart pointers?

659


Who made c++?

595


What is the difference between function overloading and operator overloading?

560


Refer to a name of class or function that is defined within a namespace?

584


What is the basic concept of c++?

561






What is the use of data hiding?

582


C is to C++ as 1 is to a) What the heck b) 2 c) 10

626


What is a unnitialised pointer?

518


total amount of milk produced each morning and then calculates and outputs the number of cartons needed for this milk , the cost of producing the milk and the profit from producing this milk.

2070


What's the "software peter principleā€?

605


What do you mean by a template?

605


What does obj stand for?

614


What are the uses of c++ in the real world?

546


What is a Default constructor?

895


write a program that withdrawals,deposits,balance check,shows mini statement. (using functions,pointers and arrays)

1794