题目
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
题目:
Determine whether an integer is a palindrome. Do this without extra space.
解题思路:
判断一个int型整数是不是回文数字,这个题也不难,依次取得数字最高位和最低位进行比较,就可以判断是不是回文数字。需要注意的是负数不是回文数字。
代码实现:...
分类:
其他好文 时间:
2014-06-08 15:35:48
阅读次数:
375
最长回文字串,相信做过Palindrome Partitioning II 这个题的同学应该可以很快做出来。没错,这个题还可以使用动态规划方法得到一个时间复杂度为O(n^2)的解法,当然如果你想要更好的时间复杂度的算法也是有的。好的,我们先来看看时间复杂度为O(n^2)的算法。
代码实现--动态规划O(n^2)
相信如果你在网上看过了别人的算法,你会发现我的算法是最简洁的。哈哈,这个题需要注意的是如果你用惯了vector的话,你这里肯定会得到超时的提示...
...代码二--复杂度为O(n)的算法...
分类:
其他好文 时间:
2014-06-07 12:08:43
阅读次数:
224
title:
Largest palindrome product
Problem 4
A palindromic number reads the same both ways. The largest palindrome made from the product of two 2-digit numbers is 9009 = 91
99.
Find the l...
分类:
其他好文 时间:
2014-06-07 01:24:27
阅读次数:
398
相比Java的MapReduce
api,Pig为大型数据集的处理提供了更高层次的抽象,与MapReduce相比,Pig提供了更丰富的数据结构,一般都是多值和嵌套的数据结构。Pig还提供了一套更强大的数据变换操作,包括在MapReduce中被忽视的连接Join操作。Hadoop版本:2.2.0Pig...
分类:
其他好文 时间:
2014-06-05 20:08:13
阅读次数:
373
Hadoop是云计算的事实标准软件框架,是云计算理念、机制和商业化的具体实现,是整个云计算技术学习中公认的核心和最具有价值内容。如何从企业级开发实战的角度开始,在实际企业级动手操作中深入浅出并循序渐进的掌握Hadoop是本课程的核心。云计算学习者的心声:如何从企业级开发的角度,不断动手实际操作,循序...
分类:
其他好文 时间:
2014-06-05 14:25:48
阅读次数:
300
题目链接判断字符串是否为回文串。附上代码: 1 class Solution { 2 public:
3 bool isPalindrome(string s) { 4 if (s.empty()) return true; // consider empty
string ...
分类:
其他好文 时间:
2014-05-30 21:48:12
阅读次数:
347
Given a string, determine if it is a
palindrome, considering only alphanumeric characters and ignoring cases.For
example,"A man, a plan, a canal: Pana...
分类:
其他好文 时间:
2014-05-30 16:24:31
阅读次数:
222
Given a strings, partitionssuch that every
substring of the partition is a palindrome.Return all possible palindrome
partitioning ofs.For example, giv...
分类:
其他好文 时间:
2014-05-30 16:04:06
阅读次数:
237
Given a strings, partitionssuch that every
substring of the partition is a palindrome.Return the minimum cuts needed for a
palindrome partitioning ofs...
分类:
其他好文 时间:
2014-05-30 15:13:10
阅读次数:
262