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

Method insert

Graphs/dijkstra_algorithm.py:34–39  ·  view source on GitHub ↗
(self, tup)

Source from the content-addressed store, hash-verified

32 self.min_heapify(smallest)
33
34 def insert(self, tup):
35 # Inserts a node into the Priority Queue
36 self.pos[tup[1]] = self.cur_size
37 self.cur_size += 1
38 self.array.append((sys.maxsize, tup[1]))
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

Callers 1

dijkstraMethod · 0.95

Calls 1

decrease_keyMethod · 0.95

Tested by

no test coverage detected