Template Class QueueWithLinkedListSTL
Defined in File queue_with_linked_list_stl.h
Class Documentation
-
template<typename T>
class QueueWithLinkedListSTL Queue with STL linked list class and all related functionality.
- Template Parameters:
T – Type of the implementation class.
Public Functions
-
inline void push(const T &element)
Push the element at the back of the queue.
- Parameters:
element – The element to be pushed.
-
inline T pop()
Pop the element from the front of the queue and return its value.
- Throws:
std::out_of_range – stating that “Queue is empty”.
- Returns:
The value of the popped element.
-
inline T peek() const
Get the value of the element at the front of the queue.
- Throws:
std::out_of_range – stating that “Queue is empty”.
- Returns:
The value of the element at the front of the queue.
-
inline size_t size() const
Get the size of the queue.
- Returns:
The current size of the queue.