struct ListNode* ReverseList(struct ListNode* pHead ) { // write code here struct ListNode *p=pHead,*q=pHead->next,*x; if(pHead==NULL) return NULL; if(q==NULL) return pHead; while(x!=NULL){ x=q->next; q->next=p; p=q; q=x; } pHead->next=NULL; return p; }