This code is showing declaration errors.
Merge Linked lists doubt
thanks a lot.I understood.
1 Like
but after this it is showing run error now.
this is it.
hi @srshubhi398
- there are multiple test cases in the question, your program is for 1 test case only. Take input t and run the program for each test case.
- You are doing
cout << headhead is a pointer, so it stores a head. When you directly print head like this, it will print the address of head. Call the print() function for head.
I shall try.Thankyou
1 Like
still the wrong answer.
@srshubhi398 buildlist function was wrong. you are taking input later but already inserted the value? How can you do that…first you take user input THEN you insert it in the list.
Secondly, do not print arrows in the print function.
corrected code:
1 Like
Thank you very much for explaining my mistakes and correcting the code.
1 Like
