Getting segmentation error in the following code


this is just a simple code for preorder building and printing a binary tree but here i’m not getting any output. it’s show segmentation error and i’m not able to rectify my mistake. Please help me in identifying my mistake.

hi @mvermav19,
if(root == NULL) not root = NULL

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.

OOkay
got my mistake!