One principle problem of educating software engineers is that they will not use a new method until they believe it works and, more importantly, that they will not believe the method will work until they see it for themselves. Humphrey

Move last element to front

Language Java | Level Intermediate | Category Data structure | September 5, 2015 10:47 pm


Data structure Description

Write a program to swap the second node from the head node to the second node from the tail node in linked list. The singly linked list allows only forward iteration and does not support backward iteration.


Output

   					 

Print the list of items: 1->2->3->4->5->6->7->8->NULL
Print the list of items after pairwise Swap: 1->7->3->4->5->6->2->8->NULL

				    

Comments


No comments available!

Please login to add comments.