int floor(Node* root, int x) {
if(root==NULL)
return -1;
if(root->data ==x)
return root->data;
if(root->data < x)
{
int fright=floor(root->right,x);
if(fright==-1)
return root->data;
return fright;
}
else
return floor(root->left,x);
}