stl类queue

template<class T,class container=deque<T> > class queue { public: explicit queue(container &cn=container()); //dafault constructor initializes an empty queue //precondition :None //postcondition :An empty queue exists; bool empty()const; //determines if the queue is empty //precondition :None //postcondition :return true if the queue is empty //otherwise returns false size_type size()const; //determines the size of the queue ,the return type //size_type is an integral type. //precondition :None; //postcondition:return the number of items that are //currently in the queue T &front(); //returns a reference to the first item of the queue //precondition :none //postcondition :the item is not removed from the queue T &back(); //return a reference to the last item of the queue //precondition :none //postcondition :the item is not removed from the queue void pop(); //removes the first item in the queue; //precondition :none //postcondition:the item at the front of the queue //is removed void push(const T &x); //Inserts an item to the back of the queue //precondition :none //postcondition :the item x is at the back of the queue. };
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值