Build A BST Problem

While building BST and printing Preorder I am getting output like 1 2 3 4 5 6 7 but it is showing incorrect answer ??
How to Proceed with this problem ??
In the given test case root is taken to 4

Preorder will not be sorted.
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 https://ide.codingblocks.com/s/263851