
Desicription
Given a singly linked list, determine if it is a palindrome.
Example 1:
1 |
Input: 1->2 |
Example 2:
1 |
Input: 1->2->2->1 |
Follow up:
Could you do it in O(n) time and O(1) space?
Solution
1 |
|

Given a singly linked list, determine if it is a palindrome.
Example 1:
1 |
Input: 1->2 |
Example 2:
1 |
Input: 1->2->2->1 |
Follow up:
Could you do it in O(n) time and O(1) space?
1 |
|
近期评论