def search_bt(t, d, is_find_only=True):
    """
    Input
      t:            a node of a binary tree
      d:            target data to be found in the tree
      is_find_only: True/False, specifying type of output

    Output
      the node that contans d or None if is_find_only is True, otherwise
      the node that should be the parent node of d
    """
    if t is None:
        return
    if d < t.data:
        next = t.left
    else:
        next = t.right
    if t.data == d:
        if is_find_only:
            return t
        else:
            return
    if not is_find_only and next is None:
        return t
    return search_bt(next, d, is_find_only)