题目: 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? 题解: 推断一个链表是不是回文的,这里要求O(n)时间复杂 ...
分类:
编程语言 时间:
2017-05-22 17:48:12
阅读次数:
107
题目:
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?
题解:
判断一个链表是不是回文的,这里要求O(n)时间复杂度和O(1)的空间时间复杂度,总共想了三种办法,三种办法都用到了两个指针,符合...
分类:
编程语言 时间:
2015-07-29 12:13:09
阅读次数:
136