Go to the documentation of this file.
15 #ifndef __LINKQUEUE_HH__
16 #define __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;
324 #endif // __LINKQUEUE_HH__
~node()=default
Destroy the node object.
reference & back()
Returns a reference to the last element in the queue.
const typedef value_type & const_reference
ݵij
virtual value_type getHead() const
Get the Head object.
linkQueue()
Construct a new link Queue object.
reference & front()
Returns a reference to the next element in the queue.
bool empty() const
Test whether container is empty.
virtual value_type deQueue()
һԪ
virtual bool isEmpty() const
жӿ
virtual ~linkQueue()
Destroy the link Queue object.
void push(const value_type &val)
Inserts a new element at the end of the queue, after its current last element.
virtual void enQueue(const_reference &x)
һԪ
void pop()
Removes the next element in the queue.
size_type size() const
Returns the number of elements in the queue.
node(const value_type &data=value_type(), node *next=nullptr)
Construct a new node object.