Merge pull request #55 from pengchzn/patch-2

Update array_stack.py
This commit is contained in:
Yudong Jin 2022-12-01 22:57:32 +08:00 committed by GitHub
commit fcbe480b76
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -60,8 +60,8 @@ if __name__ == "__main__":
print("栈顶元素 peek =", peek) print("栈顶元素 peek =", peek)
""" 访问索引 index 处元素 """ """ 访问索引 index 处元素 """
num = stack.get(3); num = stack.get(3)
print("栈索引 3 处的元素为 num =", num); print("栈索引 3 处的元素为 num =", num)
""" 元素出栈 """ """ 元素出栈 """
pop = stack.pop() pop = stack.pop()
@ -74,4 +74,4 @@ if __name__ == "__main__":
""" 判断是否为空 """ """ 判断是否为空 """
is_empty = stack.is_empty() is_empty = stack.is_empty()
print("栈是否为空 =", is_empty) print("栈是否为空 =", is_empty)