关于这道题目,不得不感慨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
今天用因为用git,所以把项目移出了workspace(git不推荐将repository放到workspace里面),然后就报错: Archive for required library XXX in project cannot be read or is not a valid ZIP file 发现项目下的...
分类:
移动开发 时间:
2014-11-16 18:57:45
阅读次数:
185
Valid NumberValidate if a given string is numeric.Some examples:"0"=>true" 0.1 "=>true"abc"=>false"1 a"=>false"2e10"=>trueNote:It is intended for the ...
分类:
其他好文 时间:
2014-11-16 13:16:23
阅读次数:
133
这道题让我切身体会了引用传递和值传递这两种方式的巨大差异。在isValid子函数中,若采用引用传递将board传参,程序运行时间在0.068左右,可以AC.若采用值传递将board传参,程序运行时间在2.011左右,直接TLE。一切只因为一个"&". 引用传递与值传递效率差异可以如此明显。 1 cl...
分类:
其他好文 时间:
2014-11-16 10:27:28
阅读次数:
187
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-16 01:52:28
阅读次数:
227
Given a string containing only digits, restore it by returning all possible valid IP address combinations. For example:Given "25525511135",return ["25...
分类:
其他好文 时间:
2014-11-16 00:29:23
阅读次数:
338
Given a string containing just the characters'(',')','{','}','['and']', determine if the input string is valid.The brackets must close in the correct ...
分类:
其他好文 时间:
2014-11-15 15:23:46
阅读次数:
179
Given a string containing just the characters'(',')','{','}','['and']', determine if the input string is valid.The brackets must close in the correct ...
分类:
其他好文 时间:
2014-11-15 12:50:41
阅读次数:
191
Evaluate the value of an arithmetic expression inReverse Polish Notation.Valid operators are+,-,*,/. Each operand may be an integer or another express...
分类:
其他好文 时间:
2014-11-15 08:52:11
阅读次数:
170
最近在学习QT,自己仿写了一个简单的QT绘图程序,但是在退出时总是报错,断言错误:报错主要问题在_BLOCK_TYPE_IS_VALID(pHead->nBlockUse),是在关闭窗口时报的错;先前考虑是析构函数有问题,重写并且排查相关变量并未发现问题。根据报错问题又推测栈调用出现内存溢出,寻找程...
分类:
其他好文 时间:
2014-11-15 01:23:13
阅读次数:
169