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

Method is_empty

graphs/dijkstra_algorithm.py:30–42  ·  view source on GitHub ↗

Conditional boolean method to determine if the priority queue is empty or not. Examples: >>> priority_queue_test = PriorityQueue() >>> priority_queue_test.is_empty() True >>> priority_queue_test.insert((2, 'A')) >>> priority_queue_test.is_emp

(self)

Source from the content-addressed store, hash-verified

28 self.pos = {} # To store the pos of node in array
29
30 def is_empty(self):
31 """
32 Conditional boolean method to determine if the priority queue is empty or not.
33
34 Examples:
35 >>> priority_queue_test = PriorityQueue()
36 >>> priority_queue_test.is_empty()
37 True
38 >>> priority_queue_test.insert((2, 'A'))
39 >>> priority_queue_test.is_empty()
40 False
41 """
42 return self.cur_size == 0
43
44 def min_heapify(self, idx):
45 """

Callers 1

dijkstraMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected