|
Data Structures in C++
|
Doubly-linked list implementation with dynamic memory allocation. More...
#include <LinkedList.hpp>
Public Member Functions | |
| LinkedList () | |
| LinkedList (T data[]) | |
| create the structure and populate it with the data from the array More... | |
| string | getName () |
| Provides the name of the data structure as a string representation. More... | |
| virtual void | insert (T val) |
| Insert an element at the end of the list. More... | |
| virtual void | insert (T val, int index) |
| Insert an element at the specified position in the list. More... | |
| virtual T | remove (int index) |
| Remove an element from the list. More... | |
| virtual T | get (int index) |
| Get the element at the specified position in the list, without removing it. More... | |
| Iterator< T > | iterator () |
| Creates an Iterator, an object that allows the sequential access of values in a Linked List without the search overhead. More... | |
Public Member Functions inherited from ProtectedLinkedList< T > | |
| 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... | |
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 |
Doubly-linked list implementation with dynamic memory allocation.
| T | The type of object the data structure will contain |
Definition at line 17 of file LinkedList.hpp.
|
inlineexplicit |
Definition at line 19 of file LinkedList.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 24 of file LinkedList.hpp.
|
inlinevirtual |
Get the element at the specified position in the list, without removing it.
| index | index of the desired element |
Reimplemented from ProtectedLinkedList< T >.
Reimplemented in OrderedList< T >.
Definition at line 51 of file LinkedList.hpp.
|
inlinevirtual |
Provides the name of the data structure as a string representation.
Reimplemented from ProtectedLinkedList< T >.
Reimplemented in OrderedList< T >.
Definition at line 27 of file LinkedList.hpp.
|
inlinevirtual |
Insert an element at the end of the list.
| val | the value to be inserted |
Reimplemented from ProtectedLinkedList< T >.
Reimplemented in OrderedList< T >.
Definition at line 31 of file LinkedList.hpp.
|
inlinevirtual |
Insert an element at the specified position in the list.
| val | the value to be inserted |
| index | position of the list that the element will be inserted on |
Reimplemented from ProtectedLinkedList< T >.
Reimplemented in OrderedList< T >.
Definition at line 38 of file LinkedList.hpp.
|
inlinevirtual |
Creates an Iterator, an object that allows the sequential access of values in a Linked List without the search overhead.
Reimplemented from ProtectedLinkedList< T >.
Definition at line 58 of file LinkedList.hpp.
|
inlinevirtual |
Remove an element from the list.
| index | position of the element to be removed |
Reimplemented from ProtectedLinkedList< T >.
Reimplemented in OrderedList< T >.
Definition at line 45 of file LinkedList.hpp.
1.8.13