一种非递归实现二叉树的中序遍历的方法
def inorder_traverse(root):
stack = []; node = root
while len(stack) > 0 or node is not None:
while node is not None:
stack.append(node)
node = node.left
node = stack.pop()
visit(node) # 访问node节点,如输出node的value
node = node.right
牛哇牛哇