why is preorder wrong??
Print BST keys in the given range
Kunal, in this question it is mentioned that “You have to form a binary search tree from given integers.”, For this no need to build the tree using middle pointer concept, use the general method to build a tree using
if(data<=root->data)
{
root->left=insertInBST(root->left,data);
}
else
{
root->right=insertInBST(root->right,data);
}
Change your buildtree function, by this approach, and then try to submit