Even-after-odd problem linked list

can you provide some hint for this code?

hello @shubhangis248
the approach is simple.
make two list from the given list . one list for all even and one list for all odd.
once u get these two list(even and odd)
add the head of even to the tail of odd list.
and update ur head with head of odd list.


can you tell what is wrong in this approach as it is not passing only test case0?

@shubhangis248
image
u r not maintainig relative order


what is wrong in this code?
it is showing /bin/run.sh: line 4: 18 Killed ./exe this error

have u noticed that u r not keeping track of odd head and even head ?

in node*c I am keeping track of odd and even heads

u r not using it anywhere,also u r not updating ur temp pointer


updated all,but still not showing correct output

make changes at highlighted section,