i cant understand the run time error in my code.
What is wrong with the code
@Keshav,
https://ide.codingblocks.com/s/242219 corrected code.
Your logic is correct. Mistake is that don’t use if 2 times in your merge sort function. Use if and else. Because if you use 2 if conditions, then both of them are evaluated and in case l1 is exhausted l1.data will be null and it will still be checked. Hence the run error.
Rest your code is correct. Also just put a new line after every printing every testcase.