234. 回文链表c
/**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* struct ListNode *next;
* };
*/
struct ListNode* pre;
bool judge(struct ListNode* head){
if(!head) return true;
bool a=judge(head->next);
if( !a || pre->val!=head->val) return false;
pre=pre->next;
return true;
}
bool isPalindrome(struct ListNode* head) {
if(!head->next) return true;
pre=head;
return judge(head);
}