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-11-17 10:34:42
阅读次数:
168
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-11-17 09:12:02
阅读次数:
179
Implement int sqrt(int x).Compute and return the square root of x.Analysis:Using binary search to find the solution. However, what need to be consider...
分类:
其他好文 时间:
2014-11-17 01:40:04
阅读次数:
205
关于这道题目,不得不感慨leetcode真的是一个不错的网站,之前的代码是有bug的,当时AC了,现在测试用例更加完善了,于是不能AC了。
题目描述:
Given a binary tree, determine if it is a valid binary search tree (BST).
Assume a BST is defined as follows:
The le...
分类:
其他好文 时间:
2014-11-16 23:08:48
阅读次数:
362
DescriptionThere are a lot of trees in an area. A peasant wants to buy a rope to surround all these trees. So at first he must know the minimal requir...
分类:
其他好文 时间:
2014-11-16 20:04:22
阅读次数:
132
Given 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 al...
分类:
其他好文 时间:
2014-11-16 18:36:32
阅读次数:
232
Given a binary tree, return thepreordertraversal of its nodes' values.For example:Given binary tree{1,#,2,3}, 1 \ 2 / 3return[1,2,3].二叉树...
分类:
其他好文 时间:
2014-11-16 13:23:07
阅读次数:
138
转载自:http://www.xuanyusong.com/archives/1919 客户端与服务器的交互,使用JSON 和XML会感觉数据量太大,影响效率。使用二进制可以很大把空间节省。在写入二进制数据时用到的核心类就是BinaryWriter ,Binary是二进制的意思 ,可见操作二进制写....
分类:
编程语言 时间:
2014-11-16 11:50:52
阅读次数:
185
Given a binary tree and a sum, find all root-to-leaf paths where each path's sum equals the given sum.For example:Given the below binary tree andsum =...
分类:
其他好文 时间:
2014-11-16 10:35:02
阅读次数:
205