摘要: 题目描述:(链接)Given a singly linked list, determine if it is a palindrome.解题思路:使用快慢指针,找到链表的中心点,然后逆序后一半链表,最后再一一比较! 1 /** 2 * Definition for singly-linked l... 阅读全文
posted @ 2015-11-07 23:54 skycore 阅读(168) 评论(0) 推荐(0) 编辑
摘要: 题目描述:(链接)Determine whether an integer is a palindrome. Do this without extra space.解题思路:分离出首位,末位,分别比较! 1 class Solution { 2 public: 3 bool isPalin... 阅读全文
posted @ 2015-11-07 23:12 skycore 阅读(179) 评论(0) 推荐(0) 编辑