Home > Back-end >  Segment error: your program segment error, may be an array, stack overflow (for example, layer numbe
Segment error: your program segment error, may be an array, stack overflow (for example, layer numbe

Time:04-19

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!
  • Related