In this problem i am unable to access both the linkedlist in merge function.Please help me with the code
Unable to solve
The Approach is pretty simple that we will Start from the head of the two lists and consume that element from the two of the Lists first which is smaller and add that element into the ans list. After consuming, Advance the iterator to point to the next node in the list. The size of the Lists can be different so after consuming elements simultaneously from the two list, We need to check if any of the two list is empty, and add the elements of that list as it is in the answer List.
you can see this:https://ide.codingblocks.com/s/430105