#ifndef MEMGRAPH_DATA_STRUCTURES_SKIPLIST_HPP #define MEMGRAPH_DATA_STRUCTURES_SKIPLIST_HPP #include #include #include #include "utils/random/xorshift.hpp" size_t new_height(int max_height) { uint64_t rand = xorshift::next(); size_t height = 0; while(max_height-- && (rand >>= 1) & 1) height++; return height; } template struct SkipNode { SkipNode(K* key, T* item) : key(key), item(item) {} K* key; T* item; SkipNode* up; SkipNode* forward; }; template class SkipList { using Node = SkipNode; using Tower = std::array; public: SkipList() { head.fill(nullptr); } T* get(const K* const key) { size_t h = height; while(h--) { } } void put(const K* key, T* item) { auto* node = new SkipNode(key, item); Tower trace; size_t h = height - 1; while(h--) { } } void del(const K* const key) { } private: Tower head; }; #endif