Build bst (binARY SEATCH tree)

shows the preorder build wrong ???

whats the mistake ?? in my code

You are given a sorted input. You have to build a bst using that.
To build a bst, you have to pick the ,middle element and build a root node from it.Now recursively call on left subpart and right subpart(for building the left subtree and the right subtree).
Refer this

@pratyush63
why the bst doesnt adjust itself to if we provide elements just as i did

why to do as the approach to make a tree from an array??

It is mentioned in the question that you have to form a “Balanced BST”.
It you just follow the approach to make a tree, it will form a skew tree which is not balanced.
To make a balanced BST from sorted input, you should follow the approach as i have mentioned above