码迷,mamicode.com
首页 >  
搜索关键字:palindrome    ( 1561个结果
Palindrome Linked List
1. TitlePalindrome Linked List2. Http addresshttps://leetcode.com/problems/palindrome-linked-list/3. The questionGiven a singly linked list, determine...
分类:其他好文   时间:2015-11-01 21:11:39    阅读次数:218
Valid Palindrome
Given a string, determine if it is a palindrome, considering only alphanumeric characters and ignoring cases. For example,"A man, a plan, a canal: Pan...
分类:其他好文   时间:2015-11-01 10:10:58    阅读次数:101
1044 - Palindrome Partitioning(区间DP)
题目大意:给你一个字符串,问这个字符串最少有多少个回文串。区间DP直接搞#include#include#include#include#include#include#include#includeusing namespace std;typedef long long LL;const int...
分类:其他好文   时间:2015-10-27 19:16:46    阅读次数:143
leetcode 9 Palindrome Number
不能用转换成字符串的方式,那样不符合空间要求。就x按从小到大的位构造一个新的数a,看看等不等x就好了。class Solution {public: int ci(int ll){ int m=1; while(ll--){ m*=10; ...
分类:其他好文   时间:2015-10-26 20:39:15    阅读次数:138
Palindrome(Manacher)
PalindromeTime Limit: 15000MSMemory Limit: 65536KTotal Submissions: 6183Accepted: 2270DescriptionAndy the smart computer science student was attending...
分类:其他好文   时间:2015-10-25 17:54:44    阅读次数:198
[LeetCode]40. Valid Palinadrome有效回文串
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...
分类:其他好文   时间:2015-10-25 10:49:18    阅读次数:256
Palindrome Linked List - LeetCode
Given a singly linked list, determine if it is a palindrome.Follow up:Could you do it in O(n) time and O(1) space?思路:将链表前半部分反转,对比就行了。 1 class Solution...
分类:其他好文   时间:2015-10-25 06:11:39    阅读次数:153
[LeetCode] Reverse Linked List
Reverse a singly linked list.这题因为palindrome linked list 的时候需要就顺便做了一下。利用三个指针:prev, now, next 相互倒腾就行。/** * Definition for singly-linked list. * function...
分类:其他好文   时间:2015-10-25 06:06:38    阅读次数:218
[LeetCode] Palindrome Linked List
Given a singly linked list, determine if it is a palindrome.一开始想用栈,但是试来试去发现写不出来遂放弃,后来想想再不济可以转换成数组然后分别两头扫,但是这样就用了O(n) 的空间,再进一步,可不可以在链表里模拟呢。思前想后发现是可以的,只...
分类:其他好文   时间:2015-10-24 23:28:56    阅读次数:302
132. Palindrome Partitioning II (String; DP)
Given a strings, partitionssuch that every substring of the partition is a palindrome.Return the minimum cuts needed for a palindrome partitioning ofs...
分类:其他好文   时间:2015-10-23 21:36:16    阅读次数:211
1561条   上一页 1 ... 78 79 80 81 82 ... 157 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!