mirror of
https://github.com/autistic-symposium/master-algorithms-py.git
synced 2025-04-29 20:26:07 -04:00
Update stack.py
This commit is contained in:
parent
fd439a2d84
commit
975b4d7dbd
@ -10,15 +10,9 @@ class Stack:
|
|||||||
self.min_array = []
|
self.min_array = []
|
||||||
self.min = float('inf')
|
self.min = float('inf')
|
||||||
|
|
||||||
######################
|
|
||||||
# Private methods
|
|
||||||
######################
|
|
||||||
def __repr__(self):
|
def __repr__(self):
|
||||||
return f'{self.content}'
|
return f'{self.content}'
|
||||||
|
|
||||||
######################
|
|
||||||
# Properties
|
|
||||||
######################
|
|
||||||
@property
|
@property
|
||||||
def size(self):
|
def size(self):
|
||||||
return len(self.content)
|
return len(self.content)
|
||||||
@ -34,9 +28,6 @@ class Stack:
|
|||||||
def is_empty(self):
|
def is_empty(self):
|
||||||
return not bool(self.content)
|
return not bool(self.content)
|
||||||
|
|
||||||
######################
|
|
||||||
# Public methods
|
|
||||||
######################
|
|
||||||
def push(self, value):
|
def push(self, value):
|
||||||
if value < self.min:
|
if value < self.min:
|
||||||
self.min = value
|
self.min = value
|
||||||
|
Loading…
x
Reference in New Issue
Block a user