The preorder is same but there is some problem with the inorder. Please check is it correct.
Check this build function once
your code has many errors
Correct way to Build BST Tree in this case
ok
but your code is not printing preorder for rootnode.
I have added the preorder function.
i forgot to store rootNode in main()
i have added the preorder function
check now
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.