MCPcopy Create free account
hub / github.com/TheAlgorithms/Python / get_left_child_idx

Method get_left_child_idx

data_structures/heap/min_heap.py:45–46  ·  view source on GitHub ↗
(self, idx)

Source from the content-addressed store, hash-verified

43 return (idx - 1) // 2
44
45 def get_left_child_idx(self, idx):
46 return idx * 2 + 1
47
48 def get_right_child_idx(self, idx):
49 return idx * 2 + 2

Callers 1

sift_downMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected