https://ide.codingblocks.com/s/181237 I am not getting any output but the compilation is successful. What is the error?
Even After Odd no output
Hi Shruthi,
You are not mantaining the pointer to the oddList and evenList, they are pointing to the end node when u have completed iterating the list
So pass the head node as refernce and take back the result int oddhead and even head , so that the o/p can be achieved by traversing the odd & even list
I have corrected the code for u
Also, i suggest you should not just print the evenList and oddList, the entire catch if asked in the interview would be to join back the odd and even list , basically the interviewer sees the way u are handling the pointer, that is why this question is many a times asked in interview, For now u may get a accepted answer but i suggest go throught how u would attach the even head to the end of oddList
SO u`ll encounter corner cases in that situation
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.