Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- template<typename InputIt> void insert(InputIt first, InputIt last) {
- for (auto it=first; it != last; ++it) {
- size_type idx = hashIndex(*it);
- if(!(table[idx]->findElement(*it))) {
- insertElementInTable(*it);
- }
- }
- }
- size_type hashIndex(const_reference key) const {
- size_type idx = hasher{}(key) % (2^roundNum); //roundNum is initialized with 1
- size_type d{roundNum};
- if(idx < nextToSplit) {
- ++d;
- idx = hasher{}(key) % (2^d);
- }
- return idx;
- }
Add Comment
Please, Sign In to add comment