码迷,mamicode.com
首页 >  
搜索关键字:palindrome    ( 1561个结果
[LeetCode]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 ca...
分类:其他好文   时间:2015-11-10 00:21:47    阅读次数:171
[LeetCode]68. Palindrome Number回文数字
Determine whether an integer is a palindrome. Do this without extra space.click to show spoilers.Some hints:Could negative integers be palindromes? (i...
分类:其他好文   时间:2015-11-09 13:58:52    阅读次数:256
[LeetCode]Palindrome Number
题目描述:(链接)Determine whether an integer is a palindrome. Do this without extra space.解题思路:分离出首位,末位,分别比较! 1 class Solution { 2 public: 3 bool isPalin...
分类:其他好文   时间:2015-11-08 14:12:51    阅读次数:223
[LeetCode]Reverse Linked List
题目描述:(链接)Given a singly linked list, determine if it is a palindrome.解题思路:使用快慢指针,找到链表的中心点,然后逆序后一半链表,最后再一一比较! 1 /** 2 * Definition for singly-linked l....
分类:其他好文   时间:2015-11-08 14:09:56    阅读次数:185
lintcode 中等题:Palindrome Linked List 回文链表
题目回文链表设计一种方式检查一个链表是否为回文链表。样例1->2->1就是一个回文链表。挑战O(n)的时间和O(1)的额外空间。解题法一:再定义一个链表,存放链表反转的值,再以此比较两个链表中的值是否相等,时间复杂度O(N),空间复杂度O(N)/** * Definition for singly-...
分类:其他好文   时间:2015-11-05 22:17:29    阅读次数:398
Palindrome Number
问题描述Determine whether an integer is a palindrome. Do this without extra space.Some hints:Could negative integers be palindromes? (ie, -1)If you are th...
分类:其他好文   时间:2015-11-04 00:36:46    阅读次数:214
Java for LeetCode 234 Palindrome Linked List
解题思路:O(1)的空间复杂度,意味着不能通过开一个List来解决问题。我们可以把List分成前后两个部分,后半部分通过指针的相互赋值进行翻转即可。JAVA实现如下:public static boolean isPalindrome(ListNode head) { if (head == nu....
分类:编程语言   时间:2015-11-03 21:17:49    阅读次数:385
Dynamic Programming [Beginner]~A - Partitioning by Palindromes
We say a sequence of characters is a palindrome if it is the same written forwards and backwards. For example, ‘racecar’ is a palindrome, but ‘fastcar...
分类:其他好文   时间:2015-11-03 21:15:55    阅读次数:219
Palindrome Subarrays
给定输入字符串,要求判断任意子字符串是否对称。基本思路就是DP写出DP表达式为 dp[i][j] = dp[i + 1][j - 1] && (s[i] == s[j]) dp[i][j]代表s(i,j)的子串是否对称注意在for循环赋值时,这里增长的对象其实是子串的长度。长度为奇数时:(->...
分类:其他好文   时间:2015-11-03 12:10:30    阅读次数:135
Number of Islands
1. TitleNumber of Islands2. Http addresshttps://leetcode.com/problems/palindrome-linked-list/3. The questionGiven a 2d grid map of '1's (land) and '0'...
分类:其他好文   时间:2015-11-01 21:10:50    阅读次数:245
1561条   上一页 1 ... 77 78 79 80 81 ... 157 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!