Https://ide.codingblocks.com/s/200537

kindly checkout my code and debug it.
i am doing a constant mistake as writing tree code in this manner gives me many times segmentation fault error.
plz tell me where i gone wrong …

1 Like

@Srajanjaiswal
Your code was fine
Input was short
Use this input for tree
1 2 4 9 13 -1 -1 14 15 -1 5 12 -1 -1 -1 3 -1 7 10 -1 11 -1 -1 -1 -1 -1 -1