ScapeGoatTree
Loading...
Searching...
No Matches
Queue< T > Class Template Reference

#include <queue.hpp>

Public Member Functions

 ~Queue ()
 
void push (T value)
 
void pop ()
 
bool isEmpty () const
 
T front ()
 
int size () const
 

Private Attributes

QNode< T > * head {}
 
QNode< T > * tail {}
 
int nNodes {}
 

Constructor & Destructor Documentation

◆ ~Queue()

template<typename T >
Queue< T >::~Queue ( )
inline

Destroys the queue and releases memory by popping all elements.

Member Function Documentation

◆ front()

template<typename T >
T Queue< T >::front ( )

Returns the value of the front element without removing it.

◆ isEmpty()

template<typename T >
bool Queue< T >::isEmpty ( ) const

Checks if the queue is empty.

◆ pop()

template<typename T >
void Queue< T >::pop ( )

Removes the front element from the queue.

◆ push()

template<typename T >
void Queue< T >::push ( T  value)

Adds a new value to the back of the queue.

◆ size()

template<typename T >
int Queue< T >::size ( ) const

Returns the current number of elements in the queue.

Member Data Documentation

◆ head

template<typename T >
QNode<T>* Queue< T >::head {}
private

◆ nNodes

template<typename T >
int Queue< T >::nNodes {}
private

◆ tail

template<typename T >
QNode<T>* Queue< T >::tail {}
private

The documentation for this class was generated from the following files: