yinusxxxx

  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理
//
// Created by yinus on 2016/4/2.
//

#ifndef DS_AA_QUEUE_H
#define DS_AA_QUEUE_H
#include "List.h"
template <typename Object>
class Queue {
public:
    Queue():list(){}

    ~Queue(){}

    bool empty()const {
        return list.empty();
    }

    void clear(){
        list.clear();
    }

    int size(){
        return list.size();
    }

    void enQueue(const Object& x){
        list.push_back(x);
    }

    void deQueue(){
        list.pop_front();
    }

    Object& front(){
        return list.front();
    }

    Object& back(){
        return list.back();
    }
private:
    List<Object> list;
};


#endif //DS_AA_QUEUE_H

  

posted on 2016-04-02 20:15  yinusxxxx  阅读(105)  评论(0编辑  收藏  举报