Given a sorted linked list, delete all nodes that have duplicate numbers, leaving only distinct numbers from the original list.For example,Given 1->2-...
分类:
其他好文 时间:
2014-07-07 16:17:00
阅读次数:
139
Given a set of distinct integers, S, return all possible subsets.
分类:
其他好文 时间:
2014-07-07 14:31:24
阅读次数:
164
1.用一条SQL语句 查询出每门课都大于80分的学生姓名 name kecheng fenshu 张三 语文 81张三 数学 75李四 语文 76李四 数学 90王五 语文 81王五 数学 100王五 英语 90A: select distinct name from table where nam...
分类:
数据库 时间:
2014-07-03 23:12:46
阅读次数:
271
问题描写叙述 最长公共子序列,英文缩写为LCS(Longest Common Subsequence)。其定义是,一个序列 S ,假设各自是两个或多个已知序列的子序列,且是全部符合此条件序列中最长的,则 S 称为已知序列的最长公共子序列。 解决最长公共子序列,一种经常使用的办法,就是穷举法,组...
分类:
其他好文 时间:
2014-07-03 07:09:44
阅读次数:
255
//
以下是主库:
下列语句可以用来检查SQL应用能否唯一识别表列,并找出不被支持的表:查询哪个表不支持logical standby传输
SQL> select owner, table_name from dba_logstdby_not_unique where (owner, table_name) not in (select distinct owner, table_name...
分类:
数据库 时间:
2014-07-02 16:40:01
阅读次数:
368
题目大意:
求串中不同的子串的个数。
思路分析:
子串一定是某一个后缀的前缀。
所以我们把每一个后缀拿出来,分析它有多少个前缀,然后除去它与sa数组中前面那个后缀相同的前缀。
最后也就是 ans = segma (n-sa[i] + height[i])....
#include
#include
#include
#include
#define maxn 1...
分类:
其他好文 时间:
2014-07-02 07:23:21
阅读次数:
182
如将字符串‘张三,李四,王五,赵六,'转换成
1. 张三
2.李四
3.王五
4.赵六
REGEXP_SUBSTR
查询语句:
WITH TEST AS (SELECT ‘张三,李四,王五,赵六,' AS STR FROM DUAL)
SELECT DISTINCT REGEXP_SUBSTR(STR, '[^,]+', 1, LEVEL)
FROM TEST
...
分类:
数据库 时间:
2014-07-02 07:13:36
阅读次数:
208
Given a sorted linked list, delete all nodes that have duplicate numbers, leaving only distinct numbers from the original list.
分类:
其他好文 时间:
2014-07-02 00:24:04
阅读次数:
284
题目
Follow up for N-Queens problem.
Now, instead outputting board configurations, return the total number of distinct solutions.
方法
和上题方法一样,使用回溯法,结构基本相同,只需要返回数量。
public i...
分类:
其他好文 时间:
2014-06-30 06:24:22
阅读次数:
273
题目
The n-queens puzzle is the problem of placing n queens on an n×n chessboard such that no two queens attack each other.
Given an integer n, return all distinct solutions to the n-que...
分类:
其他好文 时间:
2014-06-30 00:34:18
阅读次数:
188