234. Palindrome Linked List

234. Palindrome Linked List

Could you do it in O(n) time and O(1) space?

 

 

 

O(1) space means no extra space, no extra data structure 

 

 

https://leetcode.com/problems/palindrome-linked-list/discuss/64501/Java-easy-to-understand

 

Given a singly linked list, determine if it is a palindrome.

Example 1:

Input: 1->2
Output: false

Example 2:

Input: 1->2->2->1
Output: true

Follow up:
Could you do it in O(n) time and O(1) space?

posted on 2018-08-09 17:23  猪猪🐷  阅读(85)  评论(0)    收藏  举报

导航