/Interactive-Skip-List

C++ implementation of a Skip List, with an interactive console

Primary LanguageC++

Interactive Skip List

C++ implementation of a skip list data-structure, along with an interactive console to visualize and experiment with the list.

-INF <-----------------------------------------------------> 75.000000 <----> INF
-INF <-----------------------------------------------------> 75.000000 <----> INF
-INF <-------------------> 1.000000 <----------------------> 75.000000 <----> INF
-INF <-------------------> 1.000000 <-----> 10.000000 <----> 75.000000 <----> INF
-INF <--> -100.000000 <--> 1.000000 <-----> 10.000000 <----> 75.000000 <----> INF

Demo

Example

std::vector<double> v = {90, 15, -59, 48, -1, -28};
Skip_List skip_list{v};

/// Operations
skip_list.insert(5);
skip_list.remove(90);
Node* node = skip_list.search(-1);
skip_list.remove(5);

/// Console
Console console{skip_list, "output.txt"};
console.write_to_file("output.txt");
console.run();