方法一:最简单的方式是traversal I 中的结果直接reverse就可以 同样可以采用递归的方式 方法二:这个题目除了可以使用栈数据结构,也可以使用队列数据结构 ...
分类:
其他好文 时间:
2017-04-14 23:04:17
阅读次数:
234
Problem Description One day Sophia finds a very big square. There are n trees in the square. They are all so tall. Sophia is very interesting in them. ...
分类:
其他好文 时间:
2017-04-14 19:45:50
阅读次数:
176
提示中说明了,改动后的链表相当于原树的前序遍历结果。前序遍历是根左右,因为要把转换后的左子树链接到根节点的右子树上,因此进入递归之后要先把节点的右子树保存下来,然后进入左子树,左子树转换后应该返回最后一个訪问的节点。这个节点的后继是根节点的转换后右子树。说起来很绕,可能看代码反而好一些。 注意一个问 ...
分类:
其他好文 时间:
2017-04-14 19:39:35
阅读次数:
169
题目: Given a binary tree, return the zigzag level order traversal of its nodes' values. (ie, from left to right, then right to left for the next level ...
分类:
编程语言 时间:
2017-04-14 14:36:17
阅读次数:
166
# 注释crontab任务crontab -l > ${WORK_DIR}/cron_binarysed -i 's%\(.*/home/xyz/xyz.sh\)%#\1%' ${WORK_DIR}/cron_binarycrontab ${WORK_DIR}/cron_binary # 恢复cro ...
分类:
其他好文 时间:
2017-04-14 12:51:08
阅读次数:
184
Given a binary tree, return the preorder traversal of its nodes' values. For example: Given binary tree {1,#,2,3}, 1 \ 2 / 3 return [1,2,3]. Note: Rec ...
分类:
其他好文 时间:
2017-04-13 17:00:55
阅读次数:
151
主要通过两方案来做防护,一是nginx自带模块限制请求连接数和并发数;二是筛选IP加入黑名单; 1、并发数和连接数控制的配置 nginx http配置: #请求数量控制,每秒20个 limit_req_zone $binary_remote_addr zone=one:10m rate=20r/s; ...
分类:
其他好文 时间:
2017-04-13 15:14:08
阅读次数:
204
1.点击项目-》Buid Phases-》加号点击 添加RunScript,Shell中写为python路径。一般是/usr/bin/python 2.同样是Build Phases中,Link Binary with Libraries 中, 加号,添加python.framework 至此配置就 ...
分类:
编程语言 时间:
2017-04-13 00:21:06
阅读次数:
154
A - Binary Simulation(BIT || SegmentTree) Given a binary number, we are about to do some operations on the number. Two types of operations can be here ...
分类:
其他好文 时间:
2017-04-12 19:57:50
阅读次数:
253
1 /* 2 POJ2166 Death to Binary? 3 http://poj.org/problem?id=2116 4 齐肯多夫定理 5 6 */ 7 #include 8 #include 9 #include 10 #include 11 #include 12 #include ... ...
分类:
其他好文 时间:
2017-04-12 13:28:24
阅读次数:
223