Go to the documentation of this file.
15 #ifndef INCLUDE_LINKQUEUE_HH_
16 #define INCLUDE_LINKQUEUE_HH_
235 : _front(nullptr), _rear(nullptr), _size(0)
242 node *delPtr = _front;
246 _front = _front->_next;
254 return _front ==
nullptr;
266 return _front->_data;
272 return _front->_data;
292 _rear = _front =
new node(val);
294 _rear = _rear->_next =
new node(val);
303 _rear = _front =
new node(std::move(val));
305 _rear = _rear->_next =
new node(std::move(val));
312 node *delPtr = _front;
313 _front = _front->
_next;
size_type size() const
Returns the number of elements in the queue.
linkQueue()
Construct a new link Queue object.
value_type & reference
数据的引用
reference & back()
Returns a reference to the last element in the queue.
virtual bool isEmpty() const
判队空
void pop()
Removes the next element in the queue.
virtual void enQueue(const_reference &x)
入队一个元素
void push(const value_type &val)
Inserts a new element at the end of the queue, after its current last element.
reference & front()
Returns a reference to the next element in the queue.
bool empty() const
Test whether container is empty.
~node()=default
Destroy the node object.
自定义的队列类都在Queue名字空间下(linkQueue.hh)
node(const value_type &data=value_type(), node *next=nullptr)
Construct a new node object.
const typedef value_type & const_reference
数据的常量引用
virtual value_type getHead() const
Get the Head object.
virtual ~linkQueue()
Destroy the link Queue object.
virtual value_type deQueue()
出队一个元素