题目
Given a string s, partition s such that every substring of the partition is a palindrome.
Return the minimum cuts needed for a palindrome partitioning of s.
For example, given s = "a...
分类:
其他好文 时间:
2014-06-20 13:44:18
阅读次数:
234
java实现用邻接矩阵(相邻矩阵)实现图,缺点是矩阵中大量的0元素会耗费大量的存储空间
public class Graph {
final int MAX_VERTEX = 10;// 最多10个顶点
Vertex[] vertex;// 顶点数组
int[][] adjacency;// 邻接矩阵
int numOfVertex;// 当前图...
分类:
其他好文 时间:
2014-06-20 12:12:49
阅读次数:
207
人人网的文档写的真的和屎一样,根本就不用那么复杂1.申请 APP key 和 secret
key
网址:http://dev.renren.com/2.点击网页上的按钮,跳转到http://graph.renren.com/oauth/authorize?response_type=code&cl...
分类:
Web程序 时间:
2014-06-11 09:35:36
阅读次数:
427
题目:Given a string s, partition s such that every substring of the partition is a palindrome. Return all possible palindrome partitioning of s.
解题思路:
回文划分,题目意思是给一个字符串,找出将字符串划分为一系列回文子串的各种可能组合。例如,一个子串“aab“,你需要返回["aa","b"],["a","a","b"]。这个题目的解法也是非常的典型---循环加递归,...
分类:
其他好文 时间:
2014-06-09 23:24:11
阅读次数:
256
题目:For example, given s = "aab",
Return 1 since the palindrome partitioning ["aa","b"] could be produced using 1 cut
解题思路:给一个字符串,如果字符串可以划分成若干子回文字符串,返回最小的划分数量。
这个题如果还用之前求所有划分组合的循环加递归方法的话,就会得到超时的错误。这是就要考虑别的方法,动态规划倒是一个不错的方法,但是动态规划最重要的是要找到动态方程。本题的动态方程:
dp[i] =...
分类:
其他好文 时间:
2014-06-08 14:56:58
阅读次数:
257
题目:Given a linked list and a valuex, partition it
such that all nodes less thanxcome before nodes greater than or equal tox.You
should preserve the or...
分类:
其他好文 时间:
2014-06-07 20:35:55
阅读次数:
236
查看topics:ls
/brokers/topics[mytopic]查看topic所在的broker,下面例子,mytopic在broker 0 中管理。ls
/brokers/topics/mytopic[0]查看brocker中,某个topic有多少partition:get /broker...
分类:
其他好文 时间:
2014-06-07 09:34:35
阅读次数:
222
Partition ListGiven a linked list and a valuex,
partition it such that all nodes less thanxcome before nodes greater than or
equal tox.You should pres...
分类:
其他好文 时间:
2014-06-07 06:24:57
阅读次数:
179
最近看了很多介绍图算法的文章,发现网上可以搜到的资料比较少,所以打算在这写一个介绍图算法的系列文章,一方面是帮助自己整理,另一方面也给大家分享下这方面的知识。1.1图的定义: 图(graph)由顶点(vertex)和边(edge)的集合组成,每一条边就是一个点对(v,w)。图的种类:地图,电路图,调...
分类:
其他好文 时间:
2014-06-07 06:13:29
阅读次数:
305
最近公司一SSRS报表需求改变,同比店铺的选取为连续28天有销售的店铺,思考良久,发现可以利用ROW_NUMBER() OVER(PARTITION BY
COLUMN01 ORDER BY COLUMN02)来实现,ROW_NUMBER()从1开始,按照COLUMN01分组以及COLUMN02排序...
分类:
数据库 时间:
2014-06-05 20:55:28
阅读次数:
451