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

Method is_full

data_structures/stacks/stack.py:110–121  ·  view source on GitHub ↗

>>> S = Stack() >>> S.is_full() False >>> S = Stack(1) >>> S.push(10) >>> S.is_full() True

(self)

Source from the content-addressed store, hash-verified

108 return not bool(self.stack)
109
110 def is_full(self) -> bool:
111 """
112 >>> S = Stack()
113 >>> S.is_full()
114 False
115
116 >>> S = Stack(1)
117 >>> S.push(10)
118 >>> S.is_full()
119 True
120 """
121 return self.size() == self.limit
122
123 def size(self) -> int:
124 """

Callers 1

test_stackFunction · 0.95

Calls 1

sizeMethod · 0.95

Tested by 1

test_stackFunction · 0.76