Only odd nodes being printed

hello @mohammadabdullahjawwad,
the issue is with oddLast pointer . it should point to last element of ur odd list.
but u are assigning temp pointer to it.

@aman212yadav but I am updating the value of oddLast to the last node of the odd LL till now. Should I instead traverse the odd LL after the while loop. Please tell me how I’m wrong

@mohammadabdullahjawwad
u r creating newlist for odd and even . while temp is pointer for old list thats why it is not working.

yeah after loop taverse to the end of odd list and add even list there