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
What is scope resolution operator in c++ with example?
What are the 2 main types of data structures?
What are the differences between malloc() and calloc()?
Is c++ a dying language?
Is c++ faster than c?
What do you mean by enumerated data type?
Which is best ide for c++?
What is flush programming?
how can i access a direct (absolute, not the offset) memory
address?
here is what i tried:
wrote a program that ask's for an address from the user,
creates a FAR pointer to that adress and shows it. then the
user can increment/decrement the value in that address by
pressing p(inc+) and m(dec-).
NOW, i compiled that program and opened it twice (in 2
different windows) and gave twice the same address to it.
now look what happen - if i change the value in
one "window" of the program, it DOES NOT change in the
other! even if they point to the same address in the memory!
here is the code snippet:
//------------------------------------------------------
#include How can virtual functions in c++ be implemented? Should I learn c or c++ first? what are function pointers? Is empty stack c++? What is a block in c++? What is a set in c++?