MCPcopy Index your code
hub / github.com/TheAlgorithms/Python / right

Method right

graphs/dijkstra_algorithm.py:143–154  ·  view source on GitHub ↗

Returns the index of right child Examples: >>> priority_queue_test = PriorityQueue() >>> priority_queue_test.right(0) 2 >>> priority_queue_test.right(1) 4

(self, i)

Source from the content-addressed store, hash-verified

141 return 2 * i + 1
142
143 def right(self, i):
144 """
145 Returns the index of right child
146
147 Examples:
148 >>> priority_queue_test = PriorityQueue()
149 >>> priority_queue_test.right(0)
150 2
151 >>> priority_queue_test.right(1)
152 4
153 """
154 return 2 * i + 2
155
156 def par(self, i):
157 """

Callers 2

min_heapifyMethod · 0.95
draw_crossFunction · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected