Add python code for queue

This commit is contained in:
pengchzn
2022-12-01 06:53:08 +08:00
parent a2b7586c98
commit 59e46ada82
3 changed files with 45 additions and 28 deletions

View File

@ -38,10 +38,10 @@ if __name__ == "__main__":
print("队尾出队元素 popLast= ", popLast)
print("队尾出队后 duque = ", duque)
""" 获取队列的长度 """
""" 获取双向队列的长度 """
size = len(duque)
print("队列长度 size = ", size)
print("双向队列长度 size = ", size)
""" 判断队列是否为空 """
""" 判断双向队列是否为空 """
is_empty = len(duque) == 0
print("队列是否为空 = ", is_empty)
print("双向队列是否为空 = ", is_empty)