<qiyuangong>111_Minimum_Depth_of_Binary_Tree_1.py
def minDepth( root):
    if root is None:
        return 0
    queue = [root]
    depth, rightMost = 1, root
    while len(queue) > 0:
        node = queue.pop(0)
        if node.left is None and node.right is None:
            break
        if node.left is not None:
            queue.append(node.left)
        if node.right is not None:
            queue.append(node.right)
        if node == rightMost:
            depth += 1
            if node.right is not None:
                rightMost = node.right
            else:
                rightMost = node.left
    return depth
def sample_funcname ( var_0 ) :
    if var_0 is None :
        return 0
    var_3 = [ var_0 ]
    var_5 , var_6 = 1 , var_0
    while len ( var_3 ) > 0 :
        var_9 = var_3.pop ( 0 )
        if var_9.left is None and var_9.right is None :
            break
        if var_9.left is not None :
            var_3.append ( var_9.left )
        if var_9.right is not None :
            var_3.append ( var_9.right )
        if var_9 == var_6 :
            var_5 += 1
            if var_9.right is not None :
                var_6 = var_9.right
            else :
                var_6 = var_9.left
    return var_5
