please tell me my mistakes and how to correct them
Getting wrong output
@shivamgoel150 you have to do the pre-order traversal of the whole tree,
- print root
- visit left subtree
- visit right subtree
you are doing inorder traversal.
corrected code: https://ide.codingblocks.com/s/291494