Driver program to test above function
int main ( ) { Node * head = newNode ( 50 ) ; head -> next = newNode ( 20 ) ; head -> next -> next = newNode ( 15 ) ; head -> next -> next -> next = newNode ( 20 ) ; head -> next -> next -> next -> next = newNode ( 50 ) ;