Why there is wrong answer

plz help me out sir . the wrong is be shown is testcase

@shudhanshu20092001_af6f20d24c617008 There are two problems with your code :
i) First is add System.out.println(); After you print inorder in the main function bcoz if you don’t put a
System.out.println(); Your output will look like this :


But your answer should look like this :
So do the above mentioned change.
ii) the Second problem with your code is the way in which you created BST your way is not wrong but the answer is according to way mentioned in this article : https://www.geeksforgeeks.org/sorted-array-to-balanced-bst/
Use this method to create BST and you will get correct answer.

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.