![]() |
AlgoPlus v0.1.0
|
#include <doubly_linked_list.h>
Public Member Functions | |
Iterator (const std::shared_ptr< node > &l) noexcept | |
Construct a new Iterator object. | |
Iterator & | operator= (std::shared_ptr< node > current) |
= operator for Iterator type | |
Iterator & | operator++ () |
operator ++ for type Iterator | |
Iterator | operator++ (int) |
operator ++ for type Iterator | |
Iterator & | operator-- () |
operator – for type Iterator | |
Iterator | operator-- (int) |
operator – for type iterator | |
bool | operator!= (const Iterator &it) |
operator != for type Iterator | |
T | operator* () |
operator * for type Iterator | |
doubly_linked_list (std::vector< T > _elements={}) noexcept | |
doubly_linked_list class constructor | |
doubly_linked_list (const doubly_linked_list &l) | |
copy constructor for the doubly_linked_list class | |
doubly_linked_list & | operator= (const doubly_linked_list &l) |
operator = for doubly linked list class | |
bool | empty () |
empty function. | |
size_t | size () |
size function. Returns the size of the list. | |
Iterator | begin () |
pointer that points to begin | |
Iterator | end () |
pointer that points to end | |
bool | search (T key) |
search function. | |
void | push_back (T key) |
push_back function. | |
void | push_front (T key) |
push_front function. | |
void | erase (T key) |
erase function. | |
std::vector< T > | elements () |
elements function. | |
void | reverse () |
reverse function. reverses the linked list. | |
void | visualize () |
visualize function returns a .dot file that can be previewd with graphviz plugin in vscode | |
Friends | |
std::ostream & | operator<< (std::ostream &out, doubly_linked_list< T > &l) |
<< operator for the doubly_linked_list class. | |
Iterator class.
|
inlineexplicitnoexcept |
Construct a new Iterator object.
l | doubly linked list type |
|
inline |
pointer that points to begin
|
inlineexplicit |
copy constructor for the doubly_linked_list class
l | the list we want to copy |
|
inlineexplicitnoexcept |
doubly_linked_list class constructor
__elements | you can provide the constructor with a vector of elements so you dont have to do multiple push backs yourself. |
|
inline |
elements function.
|
inline |
empty function.
|
inline |
pointer that points to end
|
inline |
erase function.
key | the key to be erased from the list. |
|
inline |
|
inline |
operator * for type Iterator
|
inline |
|
inline |
|
inline |
|
inline |
operator – for type iterator
|
inline |
operator = for doubly linked list class
l | the list we want to copy |
|
inline |
|
inline |
push_back function.
key | the key to be pushed back. |
|
inline |
push_front function.
key | the key to be pushed in front. |
|
inline |
search function.
key | the key to be searched. |