please tell me where i am doing the mistake.
Print BST keys in the given range doubt
There are few mistakes in your code, plz rectify them.
- line no 18 : use if(root==NULL)
- node* insertInBST(node*root,int data), in this function plz return root, you are not returning anything.
- Modify your range function as :
void inorder(node *root,int k1,int k2)
{
if(root==NULL)
{
return;
}
Then use the conditions similar you have used .