¡@

Home 

c++ Programming Glossary: node2

Swapping Nodes on a single linked list

http://stackoverflow.com/questions/1535988/swapping-nodes-on-a-single-linked-list

swap share improve this question Say we have Node1 Node2 Node3 Node4 Node5 To swap two nodes you need to swap the next.. next values of the nodes you want to swap. So to swap say Node2 and Node3 you effectively have to swap Node1 next with Node2.. and Node3 you effectively have to swap Node1 next with Node2 next and Node2 next with Node4 next . That will work even if..