def min_height(root):
    if (root is None):
        return 0
    height = 0
    level = [root]
    while level:
        height += 1
        new_level = []
        for node in level:
            if ((node.left is None) and (node.right is None)):
                return height
            if (node.left is not None):
                new_level.append(node.left)
            if (node.right is not None):
                new_level.append(node.right)
        level = new_level
    return height
def min_height(root):
    if (root is None):
        return 0
    height = 0
    level = [root]
    while level:
        height += 1
        new_level = []
        for node in level:
            if ((node.left is None) and (node.right is None)):
                return height
            if (node.left is not None):
                new_level.append(node.left)
            if (node.right is not None):
                new_level.append(node.right)
        level = new_level
    return height