mirror of
https://github.com/krahets/hello-algo.git
synced 2025-07-18 11:00:27 +08:00
build
This commit is contained in:
@ -365,7 +365,7 @@ Below is an example code for implementing a stack based on a linked list:
|
||||
|
||||
def is_empty(self) -> bool:
|
||||
"""判断栈是否为空"""
|
||||
return not self._peek
|
||||
return self._size == 0
|
||||
|
||||
def push(self, val: int):
|
||||
"""入栈"""
|
||||
@ -1237,7 +1237,7 @@ Since the elements to be pushed onto the stack may continuously increase, we can
|
||||
|
||||
def is_empty(self) -> bool:
|
||||
"""判断栈是否为空"""
|
||||
return self._stack == []
|
||||
return self._size == 0
|
||||
|
||||
def push(self, item: int):
|
||||
"""入栈"""
|
||||
|
Reference in New Issue
Block a user