(self, head)
| 24 | head = self.reConnect(ahead, behind) |
| 25 | # split the linkedlist in middle |
| 26 | def split(self, head): |
| 27 | fast = head |
| 28 | slow = head |
| 29 | while fast and fast.next: |
| 30 | slow = slow.next |
| 31 | fast = fast.next |
| 32 | fast = fast.next |
| 33 | middle = slow.next |
| 34 | slow.next = None |
| 35 | return head, middle |
| 36 | # reverse the behind half linkedlist |
| 37 | def reverse(self, head): |
| 38 | reHead = None |
no outgoing calls
no test coverage detected