Create tree(using preorder and inorder)

sir it is giving segmentation fault while compiling my code in hackerblocks however it is working fine on my system.
I have also tried to modify my function of creating tree by passing root node by reference but still it showing segmentation fault.

Please provide the link to your code


It was giving segmentation fault because in int main, you are initializing your inorder array with size m before taking any input for m.