MCPcopy
hub / github.com/Jack-Lee-Hiter/AlgorithmsByPython / reConnect

Method reConnect

leetcode/143. Reorder List.py:47–57  ·  view source on GitHub ↗
(self, first, second)

Source from the content-addressed store, hash-verified

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

Callers 1

reorderListMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected