![]() |
AlgoPlus v0.1.0
|
#include <skip_list.h>
Public Member Functions | |
Iterator (std::shared_ptr< node > ptr) noexcept | |
Construct a new Iterator object. | |
Iterator & | operator= (std::shared_ptr< node > current) |
= operator for Iterator type* | |
Iterator & | operator++ () |
operator ++ | |
Iterator | operator++ (int) |
operator ++ for type Iterator | |
bool | operator!= (const Iterator &it) |
operator != for type Iterator | |
T | operator* () |
operator * for type Iterator | |
skip_list (int MAX_LEVEL, float PROB) | |
skip_list constructor. | |
skip_list (const skip_list &s) | |
Copy constructor for the skip_list class. | |
skip_list & | operator= (const skip_list &s) |
operator = for the skip_list class | |
~skip_list () noexcept | |
Destroy the skip list object. | |
void | insert (T key) |
insert function. | |
Iterator | begin () |
pointer that points to the first element of the list | |
Iterator | end () |
pointer that points to the last element of the list | |
void | remove (T key) |
remove function. | |
bool | search (T key) |
search function. | |
Friends | |
std::ostream & | operator<< (std::ostream &out, skip_list< T > &l) |
visualize function returns a .dot file that can be previewd with graphviz plugin in vscode | |
Iterator class.
|
inlineexplicitnoexcept |
Construct a new Iterator object.
ptr | pointer to the node |
pointer that points to the first element of the list
pointer that points to the last element of the list
|
inline |
insert function.
key | key to be inserted. |
|
inline |
operator * for type Iterator
operator ++
|
inline |
remove function.
key | key to be removed(if exist). |
|
inline |
search function.
key | key to be searched. |
|
inline |
Copy constructor for the skip_list class.
s |
|
inlineexplicit |
skip_list constructor.
__MAX_LEVEL | max height of the list. |
__PROB | probability of increasing the height each time(by default it should be 0.5). |
|
friend |
visualize function returns a .dot file that can be previewd with graphviz plugin in vscode
operator << for skip_list<T> class.