function to print the linked list
static void printList ( Node head ) { if ( head == null ) { return ; } while ( head . next != null ) { Console . Write ( head . data + " - > " ) ; head = head . next ; } Console . Write ( head . data + " STRNEWLINE " ) ; }