Merge sorted linked lists problem


sir the code is showing time limit error. please help.

For each test case you have to consider two new linked lists.
So the statements - node *head1 = NULL and node *head2 = NULL should be inside the while(t–) loop