2 test cases are not passing in odd even odd problem


HERE IS THE LINK TO MY CODE KINDLY RESOLVE THE CODE ASAP

bruuh!!!
the problem is that when
the o/p does not come in correct order
eg. 5
12 43 1 5 6

the o/p should be 43 1 5 12 6
but ur o/p is 5 1 43 12 6

basically u are inserting the odd nodes at head, so the o/p oder is wrong

mantain a odd head , which when null should insert at front then updated oddhead
for all subsequent odd number insert them at tail and progress another pointer odd_tail which always points to head node

i hope the explanation is understandable
incase u face any issue comment below i`ll help u

the below code should only be refered once u have coded it yourself

and I`d thank u for this approach, I had been doing it in a little more complex approach all this time.

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.