please can you tell me the error in my code, its giving me runtime error.
Intersection of linked list
Ok so i understood my mistake that I didn’t put the proper conditions in while loop, but can u explain like when I didn’t put the conditions, how does the compiler gives runtime error, does it take any input and check if l1 or l2 goes to NULL??
@skaushik.46 actually runtime error must be because you were not decreasing cnt,
hence it will be an infinite loop, but as soon as l1 or l2 becomes null, null->next gives error.