摘要: Binary Tree Zigzag Level Order TraversalSep 29 '12Given 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 alternate between).For example:Given binary tree{3,9,20,#,#,15,7}, 3 / \ 9 20 / \ 15 ... 阅读全文
posted @ 2013-03-09 11:56 西施豆腐渣 阅读(125) 评论(0) 推荐(0) 编辑
摘要: Balanced Binary TreeOct 9 '12Given a binary tree, determine if it is height-balanced.For this problem, a height-balanced binary tree is defined as a binary tree in which the depth of the two subtrees ofeverynode never differ by more than 1./** * Definition for binary tree * struct TreeNode { * . 阅读全文
posted @ 2013-03-09 09:46 西施豆腐渣 阅读(120) 评论(0) 推荐(0) 编辑