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 is pretty straight forward. Could you devis...
分类:
其他好文 时间:
2014-08-29 21:28:08
阅读次数:
313
# Definition for a binary tree nodeclass TreeNode: def __init__(self, x): self.val = x self.left = None self.right = Noneclas...
分类:
其他好文 时间:
2014-08-29 17:36:18
阅读次数:
135
一、ofbiz 用自身数据库安装 1. 由 binary 安装: 由 binary 安装非常简单, 以下是安装方法: 下载ofbiz-2.0-beta1-complete.tar.gz, 注意不是ofbiz-2.0-beta1.tar.gz. tar xvzf ofbiz-2.0.beta1-...
分类:
其他好文 时间:
2014-08-29 12:49:37
阅读次数:
251
ofbiz 安装 1. 由 binary 安装:由 binary 安装非常简单, 以下是安装方法:下载ofbiz-2.0-beta1-complete.tar.gz, 注意不是ofbiz-2.0-beta1.tar.gz.tar xvzf ofbiz-2.0.beta1-complete.tar.g...
分类:
其他好文 时间:
2014-08-29 12:30:37
阅读次数:
178
LeetCode: Validata Binary Search TreeGiven a binary tree, determine if it is a valid binary search tree (BST).Assume a BST is defined as follows:The l...
分类:
其他好文 时间:
2014-08-28 23:59:16
阅读次数:
421
LeetCode: Recover Binary Search TreeTwo elements of a binary search tree (BST) are swapped by mistake.Recover the tree without changing its structure....
分类:
其他好文 时间:
2014-08-28 23:58:36
阅读次数:
385
LeetCode: Symmetric TreeGiven a binary tree, check whether it is a mirror of itself (ie, symmetric around its center).For example, this binary tree is...
分类:
其他好文 时间:
2014-08-28 22:41:16
阅读次数:
243
LeetCode: Same TreeGiven two binary trees, write a function to check if they are equal or not.Two binary trees are considered equal if they are struct...
分类:
其他好文 时间:
2014-08-28 22:40:46
阅读次数:
266
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 / \ ...
分类:
其他好文 时间:
2014-08-28 21:01:06
阅读次数:
179
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 only n...
分类:
其他好文 时间:
2014-08-28 20:57:46
阅读次数:
201