题目: Given
a binary tree, determine if it is a valid binary search tree (BST).
知识点:BST的特点:
1、一个节点的左子树的所有点都小于或等于这个点的值,右子树的所有节点的值大于该节点的值;
2、最左节点值最小,最右节点值最大;
3、中序遍历结果值是一个非降的数列
问题:如果用Integer.MAX_VAL...
分类:
其他好文 时间:
2015-03-16 23:13:11
阅读次数:
149
Given a string, determine if it is a palindrome, considering only alphanumeric characters and ignoring cases.
For example,
"A
man, a plan, a canal: Panama" is a palindrome.
"race
a car" is no...
分类:
其他好文 时间:
2015-03-16 17:48:39
阅读次数:
117
判断一个字符串是否是对称的 跳过所有非数字和字母,字母不分大小写 知道函数isalnum和tolower或者toupper就可以做了,两个指针一个指向头,一个指向尾,朝中间靠拢比较 空串是对称的 class Solution {public: bool isPalindrome(string s) ...
分类:
其他好文 时间:
2015-03-16 16:13:52
阅读次数:
150
在使用caffe时,我们希望使用自己的数据进行训练,以下给出如何制作自己的数据。所有的数据制作都是基于imagenet的。1.数据准备,我们需要一个train和valid文件夹,一个train.txt和val.txt(图片文件夹的位置可以任意,但是这两个txt文件的位置在data/mydata/目录...
分类:
其他好文 时间:
2015-03-16 12:44:35
阅读次数:
174
题目链接:Valid Number
Validate if a given string is numeric.
Some examples:
"0" => true
" 0.1 " => true
"abc" => false
"1 a" => false
"2e10" => true
Note: It is intended for the problem stat...
分类:
其他好文 时间:
2015-03-15 23:42:43
阅读次数:
286
Spring如何绑定请求参数或PathVariable参数绑定到对象,并做使用@Valid做JSR303校验 ==== ###问题描述 以前在Spring中只对@RequestBody映射的请求参数使用过@Valid做JSR303校验,RequestBody一般适用与Json或者X...
分类:
编程语言 时间:
2015-03-14 20:17:22
阅读次数:
216
http://blog.csdn.net/chocolateloveme/article/details/16900999详细错误信息如下:No architectures to compile for (ONLY_ACTIVE_ARCH=YES, active arch=x86_64, VALID...
分类:
其他好文 时间:
2015-03-14 19:51:49
阅读次数:
111
题目地址:https://leetcode.com/problems/longest-valid-parentheses/Given a string containing just the characters ‘(’ and ‘)’, find the length of the longest valid (well-formed) parentheses substring.
For “(...
分类:
其他好文 时间:
2015-03-14 16:55:18
阅读次数:
188
Valid Palindrome问题:Given a string, determine if it is a palindrome, considering only alphanumeric characters and ignoring cases.思路: 简单的数学推导我的代码:publi....
分类:
其他好文 时间:
2015-03-14 15:14:52
阅读次数:
82
Valid Parentheses问题:Given a string containing just the characters'(',')','{','}','['and']', determine if the input string is valid.The brackets must c...
分类:
其他好文 时间:
2015-03-13 22:11:32
阅读次数:
198