def depth(root):
    """ root is a tree node pointer that has access to left and right,
        returns the height of the tree + 1  """
    if root is None:
        return 0
    return 1 + max(depth(root.l), depth(root.r))