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

Function get_child_right_position

graphs/minimum_spanning_tree_prims2.py:40–47  ·  view source on GitHub ↗

heap helper function get the position of the right child of the current node >>> get_child_right_position(0) 2

(position: int)

Source from the content-addressed store, hash-verified

38
39
40def get_child_right_position(position: int) -> int:
41 """
42 heap helper function get the position of the right child of the current node
43
44 >>> get_child_right_position(0)
45 2
46 """
47 return (2 * position) + 2
48
49
50class MinPriorityQueue[T]:

Callers 1

_bubble_downMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected