Let us change our traditional attitude to the construction of programs. Instead of imagining that our main task is to instruct a computer what to to, let us concentrate rather on explaining to human beings what we want a computer to do. Donald Knuth
Write a program to swap alternative nodes in the singly linked list. Linked list node contains data and link to the next node. The utility function takes the linked list head node and returns the swapped linked list head node. The display function iterate all the nodes and display the values.
Ex 1->2->3-4>5 it should swap 2->1->3-4>5.
Print the list of items: 21->52->33->21->67->NULL Print the list of items after pairwise Swap: 52->21->21->33->67->NULL