Palindrome Linked List
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?
解题思路:
此题的题意为判断单向链表是否为回文。难点就是链表不能随机存取,而且不能反...
分类:
其他好文 时间:
2015-07-26 11:09:57
阅读次数:
87
题目描述: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? 这题思路就是把单链表的前半部分或后半部分反转,然后比较。s....
分类:
其他好文 时间:
2015-07-25 19:40:11
阅读次数:
106
??DescriptionKeeping 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 ...
分类:
其他好文 时间:
2015-07-25 18:10:14
阅读次数:
102
Given a string, determine if it is a palindrome, considering only alphanumeric characters and ignoring cases.
For example,
"A man, a plan, a canal: Panama" is a palindrome.
"race a car" is not a ...
分类:
其他好文 时间:
2015-07-25 13:54:03
阅读次数:
101
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-07-24 22:29:39
阅读次数:
145
LeetCode 之 Valid Palindrome,本文给出详细算法思想与源码实现。...
分类:
其他好文 时间:
2015-07-23 10:43:50
阅读次数:
129
2.7 Implement a function to check if a linked list is a palindrome.LeetCode上的原题,参见我之前的博客Palindrome Linked List 回文链表。
分类:
其他好文 时间:
2015-07-22 22:22:58
阅读次数:
108
Given a string, determine if it is a palindrome, considering only alphanumeric characters and ignoring cases.
For example,
"A man, a plan, a canal: Panama" is a palindrome.
"race a car" is not a...
分类:
其他好文 时间:
2015-07-22 18:53:19
阅读次数:
93
LeetCode 之 Valid Palindrome,本文给出详细算法思想与源码实现。...
分类:
其他好文 时间:
2015-07-22 13:24:12
阅读次数:
104
Determine whether an integer is a palindrome. Do this without extra space.class Solution {public: bool isPalindrome(int x) { if(x = 1){ ...
分类:
其他好文 时间:
2015-07-22 06:46:22
阅读次数:
144