https://leetcode.com/problems/partition-list/Partition ListGiven a linked list and a valuex, partition it such that all nodes less thanxcome before no...
分类:
其他好文 时间:
2015-06-29 21:50:21
阅读次数:
107
其实使用分析函数进行处理是很好的方式,翻一下Tom的书,将其中的一个例子收录在这里. 比如查询scott.emp表的用户SAL排序信息,可以使用如下查询:SQL> SELECT deptno, ename, 2 ROW_NUMBER () OVER (PARTITION BY de...
分类:
其他好文 时间:
2015-06-29 19:35:12
阅读次数:
104
public class Environment { /** * Return root of the "system" partition holding the core Android OS. * Always present and mounted read-only....
分类:
其他好文 时间:
2015-06-28 23:04:41
阅读次数:
146
Determine whether an integer is a palindrome. Do this without extra space.click to show spoilers.Some hints:
Could negative integers be palindromes? (ie, -1)If you are thinking of converting the inte...
分类:
其他好文 时间:
2015-06-28 21:42:54
阅读次数:
133
select id, grp_factor,sum (id) over(partition by grp_factor order by id rows between unbounded preceding and current row) running_sumfrom NUMBERS wher...
分类:
数据库 时间:
2015-06-28 17:32:45
阅读次数:
136
1 class Solution { 2 public: 3 /** 4 * @param s A string 5 * @return Whether the string is a valid palindrome 6 */ 7 bool isPa...
分类:
其他好文 时间:
2015-06-28 16:46:14
阅读次数:
298
题目链接 题目要求: Given a linked list and a valuex, partition it such that all nodes less thanxcome before nodes greater than or equal tox. You should p...
分类:
其他好文 时间:
2015-06-26 19:22:16
阅读次数:
155
1. Question确定一个数是否是回文数。要求不使用额外空间。Determine whether an integer is a palindrome. Do this without extra space.2. Solution如果是负数,就不是回文数。2.1 reverse integer...
分类:
其他好文 时间:
2015-06-23 23:04:49
阅读次数:
132
题目:判断一个数是不是回文数Determine whether an integer is a palindrome. Do this without extra space.思路:借助上一道求整数逆序的思路,判断逆序后的数和原数是否相等就行。要注意,负数都不是回文数11506 / 11506 te...
分类:
其他好文 时间:
2015-06-23 19:48:42
阅读次数:
111
题目:给你一个字符串,可以进行增删改三种操作,问变成回文串最少的操作次数。
分析:动态规划,dp,LCS。可以利用区间dp求解,这里利用LCS求解更快。
利用字符串和自己的翻转求最大公共子序列,然后枚举所有的dp[i][len-i],
找最小的即可。注意可能最小值在dp[i-1][len-i],即str[i]为中间元素,不用匹配。
说明:注意...
分类:
其他好文 时间:
2015-06-23 15:38:53
阅读次数:
77