摘要: Given a binary tree, check whether it is a mirror of itself (ie, symmetric around its center).For example, this binary tree is symmetric: 1 / \ ... 阅读全文
posted @ 2015-05-22 00:52 TonyLuis 阅读(178) 评论(0) 推荐(0)
摘要: Given two binary trees, write a function to check if they are equal or not.Two binary trees are considered equal if they are structurally identical an... 阅读全文
posted @ 2015-05-22 00:22 TonyLuis 阅读(176) 评论(0) 推荐(0)
摘要: Two elements of a binary search tree (BST) are swapped by mistake.Recover the tree without changing its structure.解题思路:先中序遍历找到mistake,然后替换即可,JAVA实现如下:... 阅读全文
posted @ 2015-05-22 00:09 TonyLuis 阅读(154) 评论(0) 推荐(0)