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

Method is_empty

data_structures/stacks/stack.py:43–45  ·  view source on GitHub ↗

Check if a stack is empty.

(self)

Source from the content-addressed store, hash-verified

41 return self.stack[-1]
42
43 def is_empty(self):
44 """ Check if a stack is empty."""
45 return not bool(self.stack)
46
47 def size(self):
48 """ Return the size of the stack."""

Callers 3

infix_to_postfixFunction · 0.95
balanced_parenthesesFunction · 0.95
stack.pyFile · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected