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

Method split

leetcode/143. Reorder List.py:26–35  ·  view source on GitHub ↗
(self, head)

Source from the content-addressed store, hash-verified

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

Callers 10

reorderListMethod · 0.95
buildParseTreeFunction · 0.80
infixToPostfixFunction · 0.80
DeserializeMethod · 0.80
ReverseSentence2Method · 0.80
loadDataSetFunction · 0.80
colicTestFunction · 0.80
loadDataSetFunction · 0.80
deserializeMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected