You need to call the left tree recursively, may be something like this would work -
Node* GetNodeAtCount(Node *r, int x)
{
if(r != NULL)
{
if(r->count == x) {return r;}
Node *temp = GetNodeAtCount(r->right, x); //check right tree for match
if (temp != NULL)
return temp;
return GetNodeAtCount(r->left, x); // if right tree does not match further go into left tree
}
return NULL //return NULL if it is the end of tree so that the check temp != NULL will work correctly
}
let me know if this helps you.