What’s the mistake in the code?
Code not taking all inputs
@J19APPPP0007
You missed the initial condition in your insert at tail function when head is NULL.
Use this piece of code
if(head == NULL) {
head = new Node(data) ;
return ;
}
This comes at the starting of the insertAtTail( ) .