def exists_in_tree(node, n):
    """This function finds if an element exists in a BST or not by recursively traversing the tree
        input : current node and the element to be found
        output : returns True if it exists, False if not
        Time complexity : O(log(n)), Space complexity : O(1)
    """
    if node == None:
        return False
    if node.data == n:
        return True
    
    if node.data > n:
        return exists_in_tree(node.left, n)
    elif  node.data < n:
        return exists_in_tree(node.right, n)
    else:
        return False