Driver Code
public static void Main ( ) { root = new Node ( 5 ) ; root . next = new Node ( 2 ) ; root . next . next = new Node ( 2 ) ; root . next . next . next = new Node ( 7 ) ; root . next . next . next . next = new Node ( 2 ) ; root . next . next . next . next . next = new Node ( 2 ) ; root . next . next . next . next . next . next = new Node ( 2 ) ; int key = 2 ; Console . WriteLine ( " Linked ▁ List ▁ before ▁ operations ▁ : " ) ; display ( root ) ; Console . WriteLine ( " operations : " root = keyToEnd ( root , key ) ; display ( root ) ; } }