add: 220216 [Optimise]
This commit is contained in:
parent
1da6f68efb
commit
568f4acca8
|
|
@ -34,16 +34,14 @@ public:
|
|||
break;
|
||||
|
||||
// ptr --> ptrN --> ptrNN --> ptrNNN
|
||||
ListNode* ptrNNN = ptrNN->next;
|
||||
// ListNode* ptrNNN = ptrNN->next;
|
||||
|
||||
// ptr is previous node
|
||||
// swap ptrN and ptrNN.
|
||||
ptrNN->next = ptrN;
|
||||
ptr->next = ptrNN;
|
||||
ptrN->next = ptrNNN;
|
||||
(ptr = ((ptr->next = ptrNN)->next = ptrN))->next = ptrNN->next;
|
||||
|
||||
// ptr --> ptrNN --> ptrN --> ptrNNN
|
||||
ptr = ptrN;
|
||||
// ptr = ptrN;
|
||||
}
|
||||
return ret.next;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue