快慢指针法找到链表中点。
struct ListNode*slow=head,*fast=head;
while(fast&&fast->next){
slow=slow->next;
fast=fast->next->next;
}
链表翻转方法
struct ListNode*cur=head;
struct ListNode*pre=NULL;
while(cur){
struct ListNode*temp=cur->next;
cur->next=pre;
pre=cur;
cur=temp;
}
组合起来可用于判断链表回文