Not passing any test case

@G_rahil hey your print function is not correct you cant call just recursion on left and then print condition then right ,before calling recursion you have to check the condition ,see this code ,you will get it and please dry run it also:
void Print(node *root, int k1, int k2)

{

/* base case */

if ( NULL == root )

return ;

/* Since the desired o/p is sorted,

recurse for left subtree first

If root->data is greater than k1,

then only we can get o/p keys

in left subtree */

if ( k1 < root->data )

Print(root->left, k1, k2);

/* if root's data lies in range,

then prints root's data */

if ( k1 <= root->data && k2 >= root->data )

cout<<root->data<< " " ;

/* If root->data is smaller than k2,

then only we can get o/p keys

in right subtree */

if ( k2 > root->data )

Print(root->right, k1, k2);

}

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.