Apparently BFS is the most obvious one.. but it is not that simple - only constant extra space is provided.Then the only strategy to take is recursion...
分类:
其他好文 时间:
2014-07-22 00:39:35
阅读次数:
258
The trick is, we can work on a reversed vector - learnt from EPI.class Solution {public: vector plusOne(vector &digits) { std::reverse(digit...
分类:
其他好文 时间:
2014-07-22 00:33:36
阅读次数:
223
用G++过了,c++无限WA
就是一水,就是求输入的字符串中是否有一个是其他字符串的子串;
注意这种数据。。。
0000
010
01
9
字符串的长度从大到小;
#include
#include
#include
using namespace std;
char qq[20005];
struct node{
int q[2];
int w;
node...
分类:
其他好文 时间:
2014-07-22 00:30:36
阅读次数:
192
1 live in 居住 2 dish 盘,菜肴 e.g. Surprise a new neighbour with one of your favourite home-made dishes! 3 put away 收好,储存 e.g. Her bed was crisply made收拾的很...
分类:
其他好文 时间:
2014-07-21 08:11:02
阅读次数:
222
Problem Description
Whuacmers use coins.They have coins of value A1,A2,A3...An Silverland dollar. One day Hibix opened purse and found there were some coins. He decided to buy a very nice watch in...
分类:
其他好文 时间:
2014-07-20 23:01:28
阅读次数:
271
/*主要思路;
用一个链表存储数组信息,然后依次找出这个链表中最小的数字,然后插入到另外一个链表中,并删除原来链表中最小数字这个节点,一共循环n次,然后另外一个链表中的数字就是排序好的数组,依次输出即可;
*/
#include
using namespace std;
#include
class Node /...
分类:
其他好文 时间:
2014-07-20 22:47:23
阅读次数:
256
简单的二叉树的先根遍历模板的应用
class Solution:
# @param root, a tree node
# @return an integer
def hehe(self, num, root):
#再原来的基础上*10,再加上当前的root.val
num = num * 10 + root.val
...
分类:
其他好文 时间:
2014-07-20 22:45:33
阅读次数:
299
采用一维数组建树。(因为一维数组建的是完全二叉树,时间上比用孩子节点指针建树慢,不过基本可以忽略=-=)
#include
#include
#include
using namespace std;
const int INF = 0xffffff0;
int minV=INF;
int maxV=-INF;
struct Node
{
int L,R;
int minV,ma...
分类:
其他好文 时间:
2014-07-20 22:28:44
阅读次数:
216
工作需求:项目中需要把生产库中所有的AWR报告dump出来,然后导入到方便测试的数据库中。在测试库中的AWR报告需要根据dbid和实例名逐个导出,如果遇到很多再加上RAC系统,会很麻烦。在网上找了一些脚本,发现没有适合自己的,所以就自己学习了一个存储过程来实现这样的功能。说明:在$ORACLE_HOME/rdbms/admin/awrrpti.sql中可以看到,生成AWR报告主要使用DBMS_WO...
分类:
数据库 时间:
2014-07-20 22:23:53
阅读次数:
329
现在很多人估计和我一样项目中已经开始应用起nodeJS,而伴随着项目的需求,对nodejs版本也有着各种需求,好了直接进入主题,现在node版本管理网上有很多方式,这里说两种:
第一种module n:
sudo npm install n -g
//安装node管理模块n
sudo n 0.11.12
//安装node0.11.12版本
n
//安装完成之后,直接输入n后输出当...
分类:
其他好文 时间:
2014-07-20 22:11:43
阅读次数:
322