题目:Given a singly linked list where elements are sorted in ascending order, convert it to a height balanced BST.解法一:双节点public TreeNode sortedListToBST...
分类:
其他好文 时间:
2015-12-19 06:37:24
阅读次数:
171
题意:有一排等高的树木,高度都为h。给出每棵树在数轴上的坐标,每次有可能是最左边或者最右边的立着的树倒下,概率都是0.5。最终所有树都倒下。每棵树在倒下的时候有p的概率向左倒,1-p的概率向右倒。如果某些树之间的距离小于h,那么倒下的时候可能产生连带效应。问最后所有树都倒下时,在数轴上覆盖的线段的总...
分类:
其他好文 时间:
2015-12-19 06:36:46
阅读次数:
221
使用wdcp升级数据库是一件十分必要的事情,但是很多多服务器程序不是很了解的开发者每次都会在这里叫苦不迭,因为网上很多的一些自认为详细的方法对我们来说就有点不好操作,因为我们对于不熟悉的程序连保存是什么按钮都不知道。那么这里我就给一些菜鸟开发者来分享一下完整的linux服务器wdcp升级mysql的...
分类:
数据库 时间:
2015-12-19 06:37:31
阅读次数:
244
问题:找个几个chrome扩展,发现这些原理都是通过代理替换swf播放器,并且替换crossdomain.xml修改跨域策略。但绝大多数都与SwitchyOmega冲突。核心替换规则如下: youku_loader: { find: /^http:...
分类:
Web程序 时间:
2015-12-19 06:37:32
阅读次数:
282
OLH是Oracle Loader for Hadoop的缩写,Oracle出品的大数据连接器的一个组件本文介绍的就是如何使用OLH加载Hbase表到Oracle数据库。前提:已部署Hadoop/Hive/Hbase与OLH软件 [hadoop@server1 ~]$ tree -L 1 ├── h...
分类:
数据库 时间:
2015-12-19 06:34:45
阅读次数:
517
思路:第一个数填1,以后每个数判断该数和前一个数想加是否为素数,是则填,然后标记,近一步递归求解。 然后记得回溯,继续判断下一个和前一个数之和为素数的数。/* HDU 1016 Prime Ring Problem --- 经典DFS */#include #include int n;bool p...
分类:
其他好文 时间:
2015-12-19 06:34:21
阅读次数:
194
Override使用对象的使用对象有三个,为虚方法、抽象方法、Override方法1.虚方法 public class VirtualTest { public virtual void show() //定义虚方法关键词virtual { ...
分类:
其他好文 时间:
2015-12-19 06:36:39
阅读次数:
131
Array filter creates a new array with all elements that pass the test implemented by the provided function. In this lesson we discuss how only a truth...
分类:
编程语言 时间:
2015-12-19 06:34:49
阅读次数:
149
AnagramsGiven an array of strings, return all groups of strings that are anagrams.ExampleGiven ["lint", "intl", "inlt", "code"], return ["lint", "inlt...
分类:
其他好文 时间:
2015-12-19 06:36:34
阅读次数:
159
Given a complete binary tree, count the number of nodes.Definition of a complete binary tree from Wikipedia:In a complete binary tree every level, exc...
分类:
其他好文 时间:
2015-12-19 06:34:20
阅读次数:
142
或许网络上有很多成型的介绍,我只想写下来留给自己。欢迎批评。开撸!1、第一个程序,Hello,world!古人云,学会了Hello,world!这门语言你就掌握了一半了。print("Hello,World!") 已经学了这门语言的一半,你是不是很开心?刚开始写这句代码的时候,让我想起了久违的...
分类:
编程语言 时间:
2015-12-19 06:35:52
阅读次数:
190
摄影师 为特殊的用户。它与普通用户的 登陆界面一样 ,然后 后台数据 通过 获取用户信息 来判别登陆者是否为摄影师,如果 为摄影师 ,则跳转到专属与摄影师的产品 发布界面 ,如果 不是摄影师 ,则为普通用户,然后会调到普通的 查看购买界面 。
分类:
其他好文 时间:
2015-12-19 06:33:02
阅读次数:
105
Digit CountsCount the number of k's between 0 and n. k can be 0 - 9.Exampleif n=12, k=1 in [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12], we have FIVE 1'...
分类:
其他好文 时间:
2015-12-19 06:34:14
阅读次数:
437
1.安装nwnpm install nw -g一个最最简单的nw应用,只需要有index.html和package.json文件即可2.项目准备,目录结构app文件夹+----index.html+----package.jsonindex.html代码: Hello World! ...
分类:
Web程序 时间:
2015-12-19 06:33:52
阅读次数:
265
/* POJ 3278 Catch That Cow --- 简单BFS */#include #include #include using namespace std;const int maxn = 100005;bool visit[maxn];int step[maxn];int bfs(...
分类:
其他好文 时间:
2015-12-19 06:34:10
阅读次数:
157
题意:用若干条回路覆盖01矩阵里面所有的1的方案数方法:多回路问题,需要将插头的有无加入状态里,然后沿轮廓线转移即可。简单好写。#include using namespace std;#ifndef ONLINE_JUDGE#include "local.h"#endif // ONLINE_JU...
分类:
其他好文 时间:
2015-12-19 06:32:27
阅读次数:
197
已经有一个月没有更博文了,不是忘了,而是这一个月实在是忙的没有时间,也没有心情来花上这一个小时。 研一开学前,我就一直在思考,研究生生活应该怎样度过才算有意义?专研实验室项目?找个喜欢的实习?或是潜心科研?作为一个对技术满怀热情的工科男,我一直对互联网技术有很大的兴趣,在本科阶段学习计算机专业...
分类:
其他好文 时间:
2015-12-19 06:31:59
阅读次数:
409