(self, first, second)
| 45 | return reHead |
| 46 | # merge the two linkedlist to one |
| 47 | def reConnect(self, first, second): |
| 48 | head = first |
| 49 | tail = first |
| 50 | first = first.next |
| 51 | while second: |
| 52 | tail.next = second |
| 53 | tail = tail.next |
| 54 | second = second.next |
| 55 | if first: |
| 56 | first, second = second, first |
| 57 | return head |