Pairwise swap elements of a given linked list | Recursive function to pairwise swap elements of a linked list ; There must be at - least two nodes in the list ; Swap the node 's data with data of next node  ; Call pairWiseSwap ( ) for rest of the list
static void pairWiseSwap ( node head ) { if ( head != null && head . next != null ) { swap ( head . data , head . next . data ) ; pairWiseSwap ( head . next . next ) ; } }