Else insert the temporary node after the tail of the existing node and make the temporary node as the tail of the linked list
else { while ( tail != NULL ) { if ( tail -> next == NULL ) { tail -> next = temp ; tail = tail -> next ; } tail = tail -> next ; } }