TheAlgorithms/C++ 1.0.0
All the algorithms implemented in C++
Loading...
Searching...
No Matches
data_structures::Node Struct Reference
Collaboration diagram for data_structures::Node:
[legend]

Public Member Functions

 Node (int key, int level, void *value=nullptr)
 

Public Attributes

int key
 key integer
 
void * value
 pointer of value
 
std::vector< std::shared_ptr< Node > > forward
 nodes of the given one in all levels
 

Detailed Description

Node structure [Key][Node*, Node*...]

Definition at line 33 of file skip_list.cpp.

Constructor & Destructor Documentation

◆ Node()

data_structures::Node::Node ( int key,
int level,
void * value = nullptr )
inline

Creates node with provided key, level and value

Parameters
keyis number that is used for comparision
levelis the maximum level node's going to added

Definition at line 44 of file skip_list.cpp.

44 : key(key), value(value) {
45 // Initialization of forward vector
46 for (int i = 0; i < (level + 1); i++) {
47 forward.push_back(nullptr);
48 }
49 }
void * value
pointer of value
Definition skip_list.cpp:35
int key
key integer
Definition skip_list.cpp:34
std::vector< std::shared_ptr< Node > > forward
nodes of the given one in all levels
Definition skip_list.cpp:37

Member Data Documentation

◆ forward

std::vector<std::shared_ptr<Node> > data_structures::Node::forward

nodes of the given one in all levels

Definition at line 37 of file skip_list.cpp.

◆ key

int data_structures::Node::key

key integer

Definition at line 34 of file skip_list.cpp.

◆ value

void* data_structures::Node::value

pointer of value

Definition at line 35 of file skip_list.cpp.


The documentation for this struct was generated from the following file: