Driver code
public static void Main ( String [ ] args ) { LinkedList llist = new LinkedList ( ) ; for ( int i = 8 ; i >= 1 ; i -- ) llist . push ( i ) ; Console . Write ( " Original ▁ linked ▁ list : ▁ " ) ; llist . printList ( ) ; Console . WriteLine ( " " ) ; for ( int i = 1 ; i < 9 ; i ++ ) { llist . swapKth ( i ) ; Console . WriteLine ( " Modified ▁ List ▁ for ▁ k ▁ = ▁ " + i ) ; llist . printList ( ) ; Console . WriteLine ( " " ) ; } } }