Function to print the list elements
public void printList ( ) { Node trav = head ; if ( head == null ) Console . Write ( " ▁ List ▁ is ▁ empty " ) ; while ( trav != null ) { Console . Write ( trav . val + " ▁ " ) ; trav = trav . next ; } }