Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #pragma once
- #include "SkipNode.h"
- template <class Key, class Obj>
- class SkipList
- {
- public:
- SkipList(float probability, int maxHeight, Key* maxKey);
- virtual ~SkipList();
- bool insert(Key*, Obj*);
- bool remove(Key*);
- Obj* retrieve(Key*);
- class iterator
- {
- public:
- iterator(SkipNode<Key, Obj>*);
- iterator operator++();
- private:
- SkipNode<Key, Obj>* cur;
- };
- iterator begin();
- iterator end();
- private:
- SkipNode<Key, Obj>* head;
- SkipNode<Key, Obj>* tail;
- float probability;
- int maxHeight;
- int curHeight;
- int generateHeight();
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement