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-06-03 14:00:56
阅读次数:
281
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 ...
分类:
其他好文 时间:
2014-06-03 13:53:21
阅读次数:
309
Given a roman numeral, convert it to an
integer.Input is guaranteed to be within the range from 1 to
3999.找到规则即可罗马数字的表示:I~1 V~5 X~10 L~50 C~100 D~500 ...
分类:
其他好文 时间:
2014-06-03 12:09:16
阅读次数:
210
Read Table 的语法很多,这里说一种特殊情况,Read Table
中查询的时候对标准内表经常有一种二分优化查找,用Binary
search的时候首先必须要有查询条件;但如果查询条件满足的项目不至一条时,这时得到的是这些数据中索引排在最前面的数据; 如: 001 0001
2010010....
分类:
其他好文 时间:
2014-06-03 12:06:45
阅读次数:
224
List Comprehension1.列表推导 [i for i in range(10) if
i%2 == 0] -> [0, 2, 4, 6, 8], i也可以是一个函数,该风格比C语言思想的代码风格效率高2.enumerate
取到了序列中的序列号好内容forindex,iteminenu...
分类:
编程语言 时间:
2014-06-03 09:08:01
阅读次数:
254
/*Linq JS*/ //range var aa = Enumerable.range(1,
10).toArray(); var kk = Enumerable.range(1, 10, 3).toArray(); //select kk =
Enumerabl...
分类:
Web程序 时间:
2014-06-03 08:13:47
阅读次数:
255
在Android源码中发现,会如下使用:dlsym(RTLD_DEFAULT, name);也就是说
handle=RTLD_DEFAULT,在网上查了下,大致是说会在当前进程中按照 default library search
order搜索name这个symbol。其中RTLD_DEFAULT=...
分类:
其他好文 时间:
2014-05-31 13:12:22
阅读次数:
196
KEYCODE_CALL 拨号键 5KEYCODE_ENDCALL 挂机键 6KEYCODE_HOME
按键Home 3KEYCODE_MENU 菜单键 82KEYCODE_BACK 返回键 4KEYCODE_SEARCH 搜索键 84KEYCODE_CAMERA
拍照键 ...
分类:
其他好文 时间:
2014-05-31 11:34:41
阅读次数:
377
Given an integer, convert it to a roman
numeral.Input is guaranteed to be within the range from 1 to 3999.相对应的一道题:Roman
to Interger :http://www.cnblog...
分类:
其他好文 时间:
2014-05-31 02:37:44
阅读次数:
221
Given an array where elements are sorted in
ascending order, convert it to a height balanced BST./** * Definition for binary
tree * struct TreeNode { ...
分类:
其他好文 时间:
2014-05-30 15:10:23
阅读次数:
227