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

Method is_empty

data_structures/queues/circular_queue.py:28–37  ·  view source on GitHub ↗

Checks whether the queue is empty or not >>> cq = CircularQueue(5) >>> cq.is_empty() True >>> cq.enqueue("A").is_empty() False

(self)

Source from the content-addressed store, hash-verified

26 return self.size
27
28 def is_empty(self) -> bool:
29 """
30 Checks whether the queue is empty or not
31 >>> cq = CircularQueue(5)
32 >>> cq.is_empty()
33 True
34 >>> cq.enqueue("A").is_empty()
35 False
36 """
37 return self.size == 0
38
39 def first(self):
40 """

Callers 1

firstMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected