Palindrome Linked List(leetcode234)

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

Example 1:github

Input: 1->2
Output: false

Example 2:spa

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

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

要不把List反過來試試blog

git:https://github.com/woshiyexinjie/leetcode-xinleetcode

相關文章
相關標籤/搜索