* Definition for singly-linked list.
* ListNode(int x) : val(x), next(NULL) {}
bool isPalindrome(ListNode* head) {
if(!head || !head->next) return true;
if(!head->next->next) return head->val == head->next->val;
while(fast->next &&fast->next->next)
// cout<<slow->val <<endl;
ListNode* cur=head->next;
ListNode* tmp=head->next->next;
ListNode* new_head=slow->next;
if(new_head->val !=cur->val ) return false;
new_head = new_head->next;