i am not understanding how to build the bst and i did not understand the editorial like, how to print the values. Please help me.
Question on bst
Basically, in the question you are given an array of integers, so you will use the basic way to build a tree, such that
if(root==NULL)
{
return new node(data);
}
if(data<=root->data)
{
insert in left side…
}
else
{
insert in right side…
}
For printing you will use two functions, one will be based on preorder, and other will be based on inorder, but with values between k1 and k2…