|
Data Structures in C++
|
Stack implementation with dynamic memory allocation. More...
#include <DynamicStack.hpp>
Public Member Functions | |
| DynamicStack () | |
| DynamicStack (T data[]) | |
| create the structure and populate it with the data from the array More... | |
| std::string | getName () |
| Provides the name of the data structure as a string representation. More... | |
| void | push (T val) |
| Add an element to the top of the stack. More... | |
| T | pop () |
| Remove an element from the top of the stack. More... | |
| T | peek () |
| See the value from the top of the stack, 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... | |
Public Member Functions inherited from ProtectedLinkedList< T > | |
| string | getName () |
| Provides the name of the data structure as a string representation. More... | |
| ProtectedLinkedList () | |
| ~ProtectedLinkedList () | |
| 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... | |
Public Member Functions inherited from Stack< T > | |
| std::string | getName () |
| Provides the name of the data structure as a string representation. More... | |
Additional Inherited Members | |
Protected Member Functions inherited from ProtectedLinkedList< T > | |
| 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... | |
Stack implementation with dynamic memory allocation.
| T | The type of object the data structure will contain |
Definition at line 19 of file DynamicStack.hpp.
|
inlineexplicit |
Definition at line 21 of file DynamicStack.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 25 of file DynamicStack.hpp.
|
inlinevirtual |
Provides the name of the data structure as a string representation.
Implements DataStructure.
Definition at line 27 of file DynamicStack.hpp.
|
inlinevirtual |
Outputs the number of elements stored in the structure.
Implements DataStructure.
Definition at line 43 of file DynamicStack.hpp.
|
inlinevirtual |
Check whether the structure is empty.
Implements DataStructure.
Definition at line 45 of file DynamicStack.hpp.
|
inlinevirtual |
Check whether the structure is full.
Implements DataStructure.
Definition at line 47 of file DynamicStack.hpp.
|
inlinevirtual |
See the value from the top of the stack, without removing it.
Implements Stack< T >.
Definition at line 37 of file DynamicStack.hpp.
|
inlinevirtual |
Remove an element from the top of the stack.
Implements Stack< T >.
Definition at line 31 of file DynamicStack.hpp.
|
inlinevirtual |
Add an element to the top of the stack.
| val | the value to be added to the stack |
Implements Stack< T >.
Definition at line 29 of file DynamicStack.hpp.
1.8.13