2014年6月19日

leetcode - Binary Tree Level Order Traversal i ii

摘要: 题目:Binary Tree Level Order Traversal i iii和ii的差别仅在于最后将结果逆序一下就行了,算法上基本相同个人思路:1、二叉树的层次遍历,我们一层一层地处理,用一个队列(A队列)将每一层的所有节点按照从左到右的顺序入队2、待该队列的所有节点都出队,并且用另外一个队... 阅读全文

posted @ 2014-06-19 19:48 laihaiteng 阅读(176) 评论(0) 推荐(0)

leetcode - Symmetric Tree

摘要: 题目:Symmetric TreeGiven a binary tree, check whether it is a mirror of itself (ie, symmetric around its center).For example, this binary tree is symmet... 阅读全文

posted @ 2014-06-19 13:59 laihaiteng 阅读(193) 评论(0) 推荐(0)

导航