List of inversion code, debugging time can see the results should be of
But after submitted out of the question and the
The class Solution {
Public:
ListNode * ReverseList (ListNode * pHead) {
ListNode * q=NULL;
ListNode * g=NULL;
Q=pHead - & gt; Next;
PHead - & gt; Next=NULL;
While (q!=NULL) {
G=q - & gt; Next;
Q - & gt; Next=pHead;
PHead=q;
Q=g;
}
Return pHead;
}
};
Thank you for your bosses to give directions!