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

Method is_empty

data_structures/queues/linked_queue.py:83–93  ·  view source on GitHub ↗

>>> queue = LinkedQueue() >>> queue.is_empty() True >>> for i in range(1, 6): ... queue.put(i) >>> queue.is_empty() False

(self)

Source from the content-addressed store, hash-verified

81 return " <- ".join(str(item) for item in self)
82
83 def is_empty(self) -> bool:
84 """
85 >>> queue = LinkedQueue()
86 >>> queue.is_empty()
87 True
88 >>> for i in range(1, 6):
89 ... queue.put(i)
90 >>> queue.is_empty()
91 False
92 """
93 return len(self) == 0
94
95 def put(self, item: Any) -> None:
96 """

Callers 2

putMethod · 0.95
getMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected