mirror of
https://github.com/krahets/hello-algo.git
synced 2025-07-07 06:44:57 +08:00
栈的python代码
This commit is contained in:
@ -21,7 +21,7 @@ class ArrayStack:
|
||||
return self._size
|
||||
|
||||
""" 判断栈是否为空 """
|
||||
def isEmpty(self):
|
||||
def is_empty(self):
|
||||
return self._stack == []
|
||||
|
||||
""" 入栈 """
|
||||
@ -70,4 +70,4 @@ if __name__ == "__main__":
|
||||
print("栈的长度 size = ", size)
|
||||
|
||||
""" 判断是否为空 """
|
||||
isEmpty = (stack == [])
|
||||
isEmpty = stack.is_empty()
|
||||
|
Reference in New Issue
Block a user