Why is my code not generating any output
@Anchal There was a small mistake. Now it is giving the output but i think it is giving the wrong output.
You have to build a Balanced BST . So the build function would be something like this:
nodebuild (int arr,int s,int e){
if(s>e)
return NULL;
int mid=(s+e)/2;
node* root=new node(arr[mid]);
root->left=build(arr,s,mid-1);
root->right=build(arr,mid+1,e);
return root;
}
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.