算法:1.
对root的左子树做处理,让左子树的根节点作为,根节点的右子树,并让右子树作为左子树根节点的右子树的子树2. 递归遍历右子树public void
flatten(TreeNode root) { if(root==null){ return; ...
分类:
其他好文 时间:
2014-05-26 23:39:49
阅读次数:
253
modesecurity
的特征:https://github.com/SpiderLabs/owasp-modsecurity-crs/tree/master/base_rulessnort的规则:http://cs.uccs.edu/~cs591/ids/snort/snort2_9_0/rul...
分类:
其他好文 时间:
2014-05-26 22:45:06
阅读次数:
248
最基础的search api格式是empty
search,这个search不指定任何的查询条件,就是返回cluster中的所有的index的document: GET /_search相应的消息如下:{
"hits":{ "total": 14, "hits":[ { ...
分类:
其他好文 时间:
2014-05-26 14:15:42
阅读次数:
250
题目链接题意:思路: 1 #include 2 #include 3 #include 4
#include 5 #include 6 using namespace std; 7 const int mo = 1000000000 + 7; 8
int dp[110][110][110]...
分类:
其他好文 时间:
2014-05-26 14:02:48
阅读次数:
264
1 /** 2 * 把返回的数据集转换成Tree 3 * @param array $list
要转换的数据集 4 * @param string $pid parent标记字段 5 * @param string $level level标记字段 6 *
@return array 7...
分类:
其他好文 时间:
2014-05-26 14:01:51
阅读次数:
225
在empty
search中你是否注意到了查询的结果中包含了不同的type:有来自us中的user,有来自gb中的tweet。不限值index和type我们能搜索整个cluster中的所有的document,ES会把请求分发到cluster中所有的primary和replica,然后返回结果的前十条...
分类:
其他好文 时间:
2014-05-26 13:59:11
阅读次数:
257
原题地址:https://oj.leetcode.com/problems/recover-binary-search-tree/题意:Two
elements of a binary search tree (BST) are swapped by mistake.Recover the
tree...
分类:
编程语言 时间:
2014-05-26 13:25:43
阅读次数:
261
基本上一次过,要注意边界条件的问题:如果在recursion里有两个参数int begin, end,
递归写作recursion(num, mid+1, end), 因为+号的原因,递归中是会出现begin > end
的情况的,所以考虑初始条件的时候应该要考虑充分。 1 /** 2 * Def....
分类:
其他好文 时间:
2014-05-26 12:12:49
阅读次数:
257
Given a strings1, we may represent it as a
binary tree by partitioning it to two non-empty substrings recursively.Below is
one possible representation...
分类:
其他好文 时间:
2014-05-26 11:24:36
阅读次数:
214
import re
data = open('a.txt')
fh = open('b.txt', 'w')
"""Search the string begining with '【'"""
p = re.compile(r'\s*[\u3010]')
for each_d in data:
if re.match('\s*3\d{4}', each_d):
...
分类:
编程语言 时间:
2014-05-22 17:26:17
阅读次数:
293