【题目】
Given a collection of numbers that might contain duplicates, return all possible unique permutations.
For example,
[1,1,2] have the following unique permutations:
[1,1,2], [1,2,1],
an...
分类:
其他好文 时间:
2015-01-19 12:49:17
阅读次数:
133
刚刚发了mst 的kruskal,现在再来一发,说一说prim咯。 prim适用于稠密图。 与kruskal不同,prim是从一个点开始,不断加入新的点直至连通所有点。 讲讲prim的过程,我们假定有2个集合u和v,u存放所有已经加入的点,v存放还没有加入的点,先把点编号为...
分类:
其他好文 时间:
2015-01-19 12:37:32
阅读次数:
150
kruskal是求最小生成树的算法。 首先,kruskal就是把所有边按照权值从小到大的顺序排列,这一步可以直接使用sort,然后依次考查每一条边,设w=(u,v)表示从u到v的一条边的权值为w,则有:情况1:u和v在同一个连通分量中,则加入(u,v)后会形成环,因此不能选择。情况2:...
分类:
其他好文 时间:
2015-01-19 12:10:16
阅读次数:
159
在表ALL_CONSTRAINTS中约束类型CONSTRAINT_TYPE:
C (check constraint on a table)--约束,如not null,check
P (primary key)--主键
U (unique key) --唯一键约束
R (referential integrity)--外键
--下面两个是作用于视图
V (with check opt...
分类:
数据库 时间:
2015-01-19 10:56:56
阅读次数:
201
??
字段属性设置
not null 不为空
auto_increment 设定int类型字段的值可以“自增长”,即其值无需“写入”,而会自动获得并增加
注:此属性必须随同 primary key 或 unique key 一起使用。
[primary] key: 设定为主键。是唯一键“加强”:也不能重复并且不能使用null,并且可以作为确定任意一行数据的“关键值”
unique ...
分类:
其他好文 时间:
2015-01-19 09:19:44
阅读次数:
161
http://blog.sina.com.cn/s/blog_63a48d250100smu3.html--主键约束(Primary Key constraint):要求主键列的数据唯一,并且不允许为空。--唯一约束(Unique Constraint):要求该列唯一,允许为空,但只能出现一个空值。...
分类:
数据库 时间:
2015-01-19 01:34:15
阅读次数:
1196
问题描述:
Given an array S of n integers, are there elements a, b, c, and d in S such
that a + b + c + d = target? Find all unique quadruplets in the array which gives the sum of target.
Note:...
分类:
其他好文 时间:
2015-01-18 21:09:04
阅读次数:
140
Puzzle
A children's puzzle that was popular 30 years ago consisted of a 5x5 frame which contained 24 small squares of equal size. A unique letter of the alphabet was printed on each sm...
分类:
其他好文 时间:
2015-01-17 18:09:26
阅读次数:
265
Given an array S of n integers, are there elements a, b, c, and d in S such that a + b + c + d = target? Find all unique quadruplets in the array which gives the sum of target.
Note:
Elements in...
分类:
编程语言 时间:
2015-01-17 13:59:19
阅读次数:
171
Given an array S of n integers, are there elements a, b, c in S such that a + b + c = 0? Find all unique triplets in the array which gives the sum of zero.
Note:
Elements in a triplet (a,b,c) mu...
分类:
编程语言 时间:
2015-01-17 10:02:22
阅读次数:
232