摘要: Given a binary tree, return thezigzag level ordertraversal of its nodes' values. (ie, from left to right, then right to left for the next level and al... 阅读全文
posted @ 2015-04-21 21:47 丶Blank 阅读(152) 评论(0) 推荐(0) 编辑
摘要: Given preorder and inorder traversal of a tree, construct the binary tree.题目大意:给定一个二叉树的前序和中序序列,构建出这个二叉树。解题思路:跟中序和后序一样,在先序中取出根节点,然后在中序中找到根节点,划分左右子树,递归构... 阅读全文
posted @ 2015-04-21 15:42 丶Blank 阅读(144) 评论(0) 推荐(0) 编辑
摘要: Given inorder and postorder traversal of a tree, construct the binary tree.题目大意:给定一个二叉树的中序和后续序列,构建出这个二叉树。解题思路:首先后序序列的最后一个是根节点,然后在中序序列中找到这个节点,中序序列中这个节点... 阅读全文
posted @ 2015-04-21 15:26 丶Blank 阅读(161) 评论(0) 推荐(0) 编辑