2#ifndef DATA_STRUCTURES_QUEUE_HPP_
3#define DATA_STRUCTURES_QUEUE_HPP_
8template <
class ValueType>
13 using value_type = ValueType;
21 std::cout <<
"Size of queue: " << size <<
'\n';
30 return push_all_to_vector(this->
queueFront.get(), this->size);
57 newNode->next =
nullptr;
void display() const
prints the queue into the std::cout
Definition queue.hpp:17
std::vector< value_type > toVector() const
converts the queue into the std::vector
Definition queue.hpp:29
bool isEmptyQueue() const
checks if the queue has no elements
Definition queue.hpp:49
void clear()
removes all elements from the queue
Definition queue.hpp:90
value_type front() const
Definition queue.hpp:72
std::shared_ptr< node_type > queueRear
Definition queue.hpp:99
void ensureNotEmpty() const
throws an exception if queue is empty
Definition queue.hpp:38
void enQueue(const value_type &item)
inserts a new item into the queue
Definition queue.hpp:54
void deQueue()
removes the first element from the queue
Definition queue.hpp:81
std::shared_ptr< node_type > queueFront
Definition queue.hpp:97
Provides Node class and related utilities.
Definition linkedlist_implentation_usingarray.cpp:14