checking palindrome using doubly linked list