Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- template <class T>
- void QueueList<T>::enQueue(const T& e)
- {
- if (tail_ == nullptr)
- {
- tail_ = new Node;
- head_ = tail_;
- tail_->value_ = e;
- tail_->next_ = nullptr;
- }
- else
- {
- Node* newItem = new Node;
- newItem->value_ = e;
- newItem->next_ = nullptr;
- tail_->next_ = newItem;
- tail_ = newItem;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement