TheAlgorithms/C++ 1.0.0
All the algorithms implemented in C++
|
Data structure for fast searching and insertion in \(O(\log n)\) time. More...
#include <array>
#include <cstring>
#include <ctime>
#include <iostream>
#include <memory>
#include <vector>
Go to the source code of this file.
Classes | |
struct | data_structures::Node |
class | data_structures::SkipList |
Namespaces | |
namespace | data_structures |
for IO operations | |
Functions | |
int | main () |
Variables | |
constexpr int | data_structures::MAX_LEVEL = 2 |
Maximum level of skip list. | |
constexpr float | data_structures::PROBABILITY = 0.5 |
Current probability for "coin toss". | |
Data structure for fast searching and insertion in \(O(\log n)\) time.
A skip list is a data structure that is used for storing a sorted list of items with a help of hierarchy of linked lists that connect increasingly sparse subsequences of the items
References used: GeeksForGeek, OpenGenus for PseudoCode and Code
Definition in file skip_list.cpp.
int main | ( | void | ) |
Main function: Creates and inserts random 2^[number of levels] elements into the skip lists and than displays it
Definition at line 212 of file skip_list.cpp.