MCPcopy Index your code
hub / github.com/subbarayudu-j/TheAlgorithms-Python / extract_min

Method extract_min

Graphs/dijkstra_algorithm.py:41–48  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

39 self.decrease_key((sys.maxsize, tup[1]), tup[0])
40
41 def extract_min(self):
42 # Removes and returns the min element at top of priority queue
43 min_node = self.array[0][1]
44 self.array[0] = self.array[self.cur_size - 1]
45 self.cur_size -= 1
46 self.min_heapify(1)
47 del self.pos[min_node]
48 return min_node
49
50 def left(self, i):
51 # returns the index of left child

Callers 1

dijkstraMethod · 0.95

Calls 1

min_heapifyMethod · 0.95

Tested by

no test coverage detected