摘要: 题目:Given a binary tree, determine if it is a valid binary search tree (BST).Assume a BST is defined as follows:The left subtree of a node contains onl... 阅读全文
posted @ 2014-05-19 17:30 ThreeMonkey 阅读(111) 评论(0) 推荐(0) 编辑
摘要: 题目:Two elements of a binary search tree (BST) are swapped by mistake.Recover the tree without changing its structure.Note:A solution using O(n) space ... 阅读全文
posted @ 2014-05-19 17:28 ThreeMonkey 阅读(166) 评论(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... 阅读全文
posted @ 2014-05-19 17:18 ThreeMonkey 阅读(115) 评论(0) 推荐(0) 编辑