Getting run error

@Krishna-Singh-2678805765519156 what happens in case there are repeating elements in both lists?
A simple if-else condition is enough, no need for a condition in the else part. And always initialise your nodes with NULL first, especially if you are checking if they are NULL or not.
image

getting mle error even after initializing c to null and using else coditin although sample test case shows correct. it also runs in my ide



for memory i have deleted the linked list after use

@Krishna-Singh-2678805765519156 i cant see where have you initialised nodes with NULL?

can you make the changes. i have made the merged node on line 76 and also 91 as NULL

i am getting mle error now on other cases but i think my code is correct

@Krishna-Singh-2678805765519156 i’ll look into it, please share the latest code

hi @Krishna-Singh-2678805765519156
your code is not working if there are 0 nodes in the linked list

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.

1 Like