Data Structures in C++
|
Queue implementation with dynamic memory allocation. More...
#include <DynamicQueue.hpp>
Public Member Functions | |
string | getName () |
Provides the name of the data structure as a string representation. More... | |
DynamicQueue () | |
DynamicQueue (int data[]) | |
create the structure and populate it with the data from the array More... | |
void | enqueue (T val) |
Add an element to the end of the queue. More... | |
T | dequeue () |
Remove an element from the queue. More... | |
T | peek () |
See the first value from the queue, without removing it. More... | |
int | getSize () |
Outputs the number of elements stored in the structure. More... | |
bool | isEmpty () |
Check whether the structure is empty. More... | |
bool | isFull () |
Check whether the structure is full. More... | |
![]() | |
ProtectedLinkedList () | |
~ProtectedLinkedList () | |
Additional Inherited Members | |
![]() | |
Node< T > * | getNode (int index) |
ProtectedLinkedList (const T data[]) | |
create the structure and populate it with the data from the array More... | |
Node< T > * | getFirst () const |
Node< T > * | getLast () const |
virtual void | insert (const T val) |
Insert an element at the end of the list. More... | |
virtual void | insert (const T val, const int index) |
Insert an element at the specified position in the list. More... | |
virtual T | remove (const int index) |
Remove an element from the list. More... | |
virtual T | get (const int index) |
Get the element at the specified position in the list, without removing. More... | |
virtual Iterator< T > | iterator () |
Creates an Iterator, an object that allows the sequential access of values in a Linked List without the search overhead. More... | |
Queue implementation with dynamic memory allocation.
T | The type of object the data structure will contain |
Definition at line 18 of file DynamicQueue.hpp.
|
inlineexplicit |
Definition at line 22 of file DynamicQueue.hpp.
|
inlineexplicit |
create the structure and populate it with the data from the array
data | an array with data with which the structure will be initialized |
Definition at line 26 of file DynamicQueue.hpp.
|
inlinevirtual |
Remove an element from the queue.
Implements Queue< T >.
Definition at line 32 of file DynamicQueue.hpp.
|
inlinevirtual |
Add an element to the end of the queue.
val | the value to be added to the queue |
Implements Queue< T >.
Definition at line 28 of file DynamicQueue.hpp.
|
inlinevirtual |
Provides the name of the data structure as a string representation.
Reimplemented from ProtectedLinkedList< T >.
Definition at line 20 of file DynamicQueue.hpp.
|
inlinevirtual |
Outputs the number of elements stored in the structure.
Reimplemented from ProtectedLinkedList< T >.
Definition at line 44 of file DynamicQueue.hpp.
|
inlinevirtual |
Check whether the structure is empty.
Reimplemented from ProtectedLinkedList< T >.
Definition at line 46 of file DynamicQueue.hpp.
|
inlinevirtual |
Check whether the structure is full.
Reimplemented from ProtectedLinkedList< T >.
Definition at line 48 of file DynamicQueue.hpp.
|
inlinevirtual |
See the first value from the queue, without removing it.
Implements Queue< T >.
Definition at line 38 of file DynamicQueue.hpp.