The test data is [1,2]. It returns 0 when I executed it outside the OJ.

```
bool isPalindrome(struct ListNode* head) {
if (head == NULL) return false;
if (head->next == NULL) return true;
struct ListNode *t = head;
struct ListNode *s = 0;
unsigned int dp = 0;
while (t != NULL)
{
s = t->next;
t->next = (struct ListNode *)(dp ^ (unsigned int)s);
dp = (unsigned int)t;
t = s;
}
t = (struct ListNode*)dp;
s = head;
unsigned int dt = 0;
unsigned int ds = 0;
while (t != s)
{
if (t->val != s->val)
return false;
unsigned int b = (unsigned int)t;
t = (struct ListNode*)((unsigned int)(t->next) ^ dt);
dt = b;
if (t == s) return true;
b = (unsigned int)s;
s = (struct ListNode*)((unsigned int)(s->next) ^ ds);
ds = b;
}
return false;
}
```