JavaScript简单方便,所以用JavaScript实现,可以在Chrome控制台下观察运行结果。主要实现Partition算法,比如输入为 var array = [4, 2, 1, 3, 6, 8, 9, 7, 5]; partition(array, 0, 8);那么按照array[0]即...
分类:
其他好文 时间:
2014-07-30 20:08:04
阅读次数:
418
题意:给你一个字符串,问你其中不重叠的回文字串对有多少解题思路:这题用到两种方法,不过其实是一个很巧妙的二重dp1)暴力求解以i开头,j结尾的是否为回文,如果是,ans += sum[i-1](ans 为答案, sum[i]为在 1 - i内回文串的个数--需要dp求解)这里非常耗时,时间大约为 n...
分类:
其他好文 时间:
2014-07-30 20:05:44
阅读次数:
276
http://www.cnblogs.com/umen/archive/2011/04/11/2012136.htmlSQL code: sql over的作用及用法RANK ( ) OVER ( [query_partition_clause] order_by_clause )DENSE_RAN...
分类:
数据库 时间:
2014-07-30 14:42:43
阅读次数:
328
问题描述:
Given a linked list and a value x, partition it such that all nodes less than x come before nodes greater than or equal to x.
You should preserve the original relative order of the nodes in ...
分类:
其他好文 时间:
2014-07-30 12:21:33
阅读次数:
192
Palindromes
A regular palindrome is a string of numbers or letters that is the same forward as backward. For example, the string "ABCDEDCBA" is a palindrome because it is the same when t...
分类:
其他好文 时间:
2014-07-29 21:57:12
阅读次数:
308
1. 在Guest系统里面,编辑C:\Boot.ini,注意修改只读属性[boot loader]timeout=5default=multi(0)disk(0)rdisk(0)partition(1)\WINDOWS[operating systems]multi(0)disk(0)rdisk(0...
分类:
数据库 时间:
2014-07-29 17:27:02
阅读次数:
264
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 ...
分类:
其他好文 时间:
2014-07-29 13:43:58
阅读次数:
223
??
Description
Keeping track of all the cows can be a tricky task so Farmer John has installed a system to automate it. He has installed on each cow an electronic ID tag that the system will read ...
分类:
其他好文 时间:
2014-07-29 13:22:46
阅读次数:
212
这两天去学了一下,觉得下面那篇文章写的很好,有例子,比较容易懂,所以转一下。以下内容来自:hihoCoder:小Hi和小Ho是一对好朋友,出生在信息化社会的他们对编程产生了莫大的兴趣,他们约定好互相帮助,在编程的学习道路上一同前进。这一天,他们遇到了一连串的字符串,于是小Hi就向小Ho提出了那个经典...
分类:
其他好文 时间:
2014-07-29 12:41:26
阅读次数:
292