Find Center
Slow and fast pointers locate the midpoint in one pass.
Loading...
Loading Curriculum...
Loading Subject...
Loading Topic...
Loading Lesson...
Loading Lab...
Check Palindrome finds the middle, reverses the second half, then compares mirrored nodes without copying the whole list.
Slow and fast pointers locate the midpoint in one pass.
The second half is reversed so both ends can be compared forward.
Left and right pointers must match at every step.
Production code may reverse the second half again to preserve the list.