swap nodes in doubly linked list

This is a discussion on swap nodes in doubly linked list within the C++ Programming forums, part of the General Programming Boards category; i am trying to swap two node in a doubly linked list, i have this code so far.....any hinters
Code:
...

Just as temp->next->previous->previous->next == temp, ad infinitum, so just follow the arrows. The easiest way to grasp it is to graph it out on a slip of paper to make it more clear. Second, there are a couple of different qualities of swaps. The best is to code one that will swap ANY two nodes, regardless of whether they are side by side or not. Of course, an adjacent swap algorithm can be more efficient since it optimizes for the simplest case. Anyway, so here's a hint - a node inserter: