Skip to content
Veltoryx Technologies
ProProblem 49● EasyLeetCode #234 ↗5 min readUpdated 30 October 2026

Palindrome Linked List

Determine if a singly linked list is a palindrome in O(n) time and O(1) space by reversing the second half in place.

01The problem

Given the head of a singly linked list, return true if it is a palindrome or false otherwise.

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

InputOutputWhy
[1, 2, 2, 1]trueReads 1, 2, 2, 1 forwards and backwards
[1, 2]falseFirst element (1) differs from last element (2)
[1, 2, 1]trueOdd length palindrome with center at 2
[1]trueSingle node list is trivially a palindrome

Constraints: 1 to 100,000 nodes, node values between 0 and 9.

Loading the rest of the lesson…