Segmentation fault

Why this code is giving RTE?

not this code but this one https://ide.codingblocks.com/s/256164

hello @darkshadow2708
image
u should do this only when odd_tail is not null.
if it is null then simply return even_head;

This fix won’t worked…

a) start i from 1
b) first update temp and then even_tail/odd_tail
this is correct order
image

1 Like