mysql的key和index多少有点令人迷惑,这实际上考察对数据库体系结构的了解的。1 key 是数据库的物理结构,它包含两层意义,一是约束(偏重于约束和规范数据库的结构完整性),二是索引(辅助查询用的)。包括primary key, unique key, foreign key 等。 pri....
分类:
数据库 时间:
2015-01-08 17:10:15
阅读次数:
151
题目:
Follow up for "Unique Paths":
Now consider if some obstacles are added to the grids. How many unique paths would there be?
An obstacle and empty space is marked as 1 and 0 respectively...
分类:
编程语言 时间:
2015-01-08 15:29:48
阅读次数:
162
u Mysql数据库的优化技术对mysql优化时一个综合性的技术,主要包括a: 表的设计合理化(符合3NF)b: 添加适当索引(index) [四种: 普通索引、主键索引、唯一索引unique、全文索引]c: 分表技术(水平分割、垂直分割)d: 读写[写: update/delete/add]分离e...
分类:
数据库 时间:
2015-01-08 09:30:51
阅读次数:
230
REPLACE的运行与INSERT很相似。只有一点例外,假如表中的一个旧记录与一个用于PRIMARY
KEY或一个UNIQUE索引的新记录具有相同的值,则在新记录被插入之前,旧记录被删除。
注意,除非表有一个PRIMARY KEY或UNIQUE索引,否则,使用一个REPLACE语句没有意义。该
语句会与INSERT相同,因为没有索引被用于确定是否新行复制了其它的行。
所有列的值均取自...
分类:
数据库 时间:
2015-01-07 18:50:11
阅读次数:
151
1.数组去重/*方法一: 1,'1' 会被认为是相同的; 所有hash对象,如:{x;1},{y:1}会被认为是相同的 //10ms */Array.prototype.unique=function(){ var newArr=[],obj={}; for(var i=0,len=th...
分类:
编程语言 时间:
2015-01-07 16:44:39
阅读次数:
173
Given a stringS, find the longest palindromic substring inS. You may assume that the maximum length ofSis 1000, and there exists one unique longest pa...
分类:
其他好文 时间:
2015-01-06 23:07:00
阅读次数:
208
题目:
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 tripl...
分类:
编程语言 时间:
2015-01-06 10:06:42
阅读次数:
130
题目:(DP)Givenn, generate all structurally uniqueBST's(binary search trees) that store values 1...n.For example,Givenn= 3, your program should return al...
分类:
其他好文 时间:
2015-01-06 00:41:27
阅读次数:
147
Givenn, how many structurally uniqueBST's(binary search trees) that store values 1...n?For example,Givenn= 3, there are a total of 5 unique BST's. 1.....
分类:
其他好文 时间:
2015-01-06 00:37:47
阅读次数:
204
Given a collection of candidate numbers (C) and a target number (T), find all unique combinations inCwhere the candidate numbers sums toT.Each number ...
分类:
其他好文 时间:
2015-01-05 23:22:28
阅读次数:
138