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