Palindrome Linked List
Problem
Implement a function to check if a linked list is a palindrome.
Example
Given 1->2->1
, return true
Challenge
Could you do it in O(n)
time and O(1)
space?
Implement a function to check if a linked list is a palindrome.
Given 1->2->1
, return true
Could you do it in O(n)
time and O(1)
space?