My code is same as the code made in the videos but still i am getting no output
Create tree (Using preorder and inorder)
hi @taritkandpal, change your base condition as if(index==n){return NULL;}
also use the commented preorder function
I have now corrected the index conditon. But we have to give the preorder output in a specific manner and my preorder is giving error. How to fix that?
Output Format
Display the tree using a modified preorder function. For each node , first print its left child’s data , then the data of the root itself , then the data of its right child. Do this for each node in a new line in preorder manner. If one of the children does not exist print END in its place. Refer to the sample testcase.
i got it the correct output now… it was supposed to be root->right==NULL but i wrote
root->right->data==NULL
Thnx
great !! In case of any doubt feel free to ask 