educative.io

Educative

Solution: Find if a Doubly Linked-list is a Palindrome

Here we don’t require repetitive comparison. We could restrict both pointers at when they meet each other (for odd length) or cross each other(even length).