why is it giving wrong answer while submiting,but according to me it gves correct output in custom input
Print BSt keys in the given range
Plz change your range function as per the logic as,
if(root==NULL)
{
return;
}
if(k1data)
{
inorder(root->left,k1,k2);
}
if(k1<=root->data && k2>=root->data)
{
cout<data<<" ";
}
if(k2>root->data)
{
inorder(root->right,k1,k2);
}
Include these conditions in your code and then try to submit…
could not underestand the error? could you modify the code and explain the mistake
I have edited your code, You can refer to this code…
I have added comments as well for your understanding, if you arent able to get the logic at any point, you can ask the same…