摘要: Given a binary tree, return the postorder traversal of its nodes' values.For example: Given binary tree {1,#,2,3}, 1 \ 2 / 3return [3,2,1].Note: Recursive solution is trivial, could you do it iteratively?思考:原思路是为每个节点增加一个标记。这个思路先序遍历不要标记,因为当前访问结点直接出栈,不用看是否访问过。不过此思路redefinition of 'struct... 阅读全文
posted @ 2013-11-15 12:27 七年之后 阅读(256) 评论(0) 推荐(0) 编辑