#encoding=utf-8


class Queue(object):
    """队列"""
    def __init__(self):
        self.__items = []

    def enqueue(self, item):
        """进队列"""
        self.__items.insert(0, item)

    def dequeue(self):
        """出队列"""
        return self.__items.pop()

    def is_empty(self):
        """判空"""
        return self.__items == []

    def size(self):
        """返回大小"""
        return len(self.__items)

 

posted on 2017-09-15 16:03  晴空半岛  阅读(211)  评论(0编辑  收藏  举报