Unique Binary Search Trees
My Submissions
Given n, how many structurally unique BST's (binary search trees) that store values 1...n?
For example,
Given n = 3, there are a total of 5 uniqu...
分类:
其他好文 时间:
2014-07-08 14:18:39
阅读次数:
159
Hibernate One-to-Many Mappings 一对多关系映射
关键点:一对多关系使用 Set 实现,
例子:一个员工可以有多个学证书。
Hibernate框架的使用步骤:
1、创建Hibernate的配置文件(hibernate.cfg.xml)
2、创建持久化类,即其实例需要保存到数据库中的类(Employee.java)
3、创建对象-关...
分类:
移动开发 时间:
2014-07-08 13:21:02
阅读次数:
306
Interesting enough to find out the Reader function in Safari is actually Javascript and there are many interesting stuff from the 2000 line code:
* 5 main parts in the file:
* 1. define const
* 2...
分类:
其他好文 时间:
2014-07-08 13:11:46
阅读次数:
469
Update: July 4, 2014 Chap 5: At the beginning, he mentioned that: recursion is a divide-and-conquer method. Although many algorithms can be solved in ...
分类:
其他好文 时间:
2014-07-06 15:24:36
阅读次数:
213
You are climbing a stair case. It takes n steps to reach to the top.
Each time you can either climb 1 or 2 steps. In how many distinct ways can you climb to the top?
有f(n) = f(n - 1) + f(n...
分类:
其他好文 时间:
2014-07-04 08:39:44
阅读次数:
304
原文博客链接地址:数据库open报错ORA-01555: snapshot too old
今天正在东莞蜜月的时候,一个学生说他管理的测试库出问题了,无法open,我们先来看看是什么问题:
Recovery of Online Redo Log: Thread 1 Group 4 Seq 4 Reading mem 0
Mem# 0: /onlinelog/shr/re...
分类:
数据库 时间:
2014-07-03 18:11:02
阅读次数:
329
/**** test how many threads can be created in x86 32 system* * ubuntu 13.0***************************************************************...
分类:
编程语言 时间:
2014-07-02 21:46:24
阅读次数:
178
多对一 关联映射 --- many-to-one 场景:用户和组;从用户角度来,多个用户属于一个组(多对一 关联) 使用hibernate开发的思路:先建立对象模型(领域模型),把实体抽取出来。 目前两个实体:用户和组两个实体,多个用户属于一个组,那么一个用户都会对应于一个组,所以用户实体中应该有一...
分类:
系统相关 时间:
2014-07-02 20:42:17
阅读次数:
387
题意:n个数,m次询问,每次问区间a到b之间的和为s,问有几次冲突
思路:带权并查集的应用,[a, b]和为s,所以a-1与b就可以确定一条边,通过计算与根的距离可以判断出询问的正确性
#include
#include
#include
#include
using namespace std;
const int MAXN = 200010;
int f[MAXN],arr[MA...
分类:
其他好文 时间:
2014-07-02 16:38:40
阅读次数:
177
作为一名运维人员来说,这个错误并不陌生,在执行rm、cp、mv等命令时,如果要操作的文件数很多,可能会使用通配符批量处理大量文件,这时就可能会出现“Argumentlisttoolong”这个问题了。1、错误现象这是一台Mysql数据库服务器,在系统中运行了很多定时任务,今天通过crontab..
分类:
其他好文 时间:
2014-07-02 16:07:39
阅读次数:
292