摘要: class Deque(object): """雙端隊列""" def __init__(self): self.__list = [] #存儲區 def add_front(self, item): """往隊列頭部中添加一個item元素""" self.__list.insert(0, item 阅读全文
posted @ 2019-09-13 11:22 李俊鹏Python 阅读(254) 评论(0) 推荐(0) 编辑
摘要: # coding:utf-8 class Queue(object): """隊列""" def __init__(self): self.__list = [] def enqueue(self, item): """往隊列中添加一個item元素""" self.__list.append(ite 阅读全文
posted @ 2019-09-13 10:32 李俊鹏Python 阅读(458) 评论(0) 推荐(0) 编辑