MCPcopy Index your code
hub / github.com/Jack-Lee-Hiter/AlgorithmsByPython / minChild

Method minChild

BinaryHeap.py:32–39  ·  view source on GitHub ↗
(self, i)

Source from the content-addressed store, hash-verified

30 i = mc
31
32 def minChild(self, i):
33 if i * 2 + 1 > self.currentSize:
34 return i * 2
35 else:
36 if self.heapList[i*2] < self.heapList[i*2+1]:
37 return i * 2
38 else:
39 return i * 2 + 1
40
41 def delMin(self):
42 retval = self.heapList[1]

Callers 1

percDownMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected