Guest User

Untitled

a guest
Jun 18th, 2018
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. template<typename InputIt> void insert(InputIt first, InputIt last) {
  2. for (auto it=first; it != last; ++it) {
  3. size_type idx = hashIndex(*it);
  4. if(!(table[idx]->findElement(*it))) {
  5. insertElementInTable(*it);
  6. }
  7. }
  8. }
  9.  
  10. size_type hashIndex(const_reference key) const {
  11. size_type idx = hasher{}(key) % (2^roundNum); //roundNum is initialized with 1
  12. size_type d{roundNum};
  13.  
  14. if(idx < nextToSplit) {
  15. ++d;
  16. idx = hasher{}(key) % (2^d);
  17. }
  18.  
  19. return idx;
  20. }
Add Comment
Please, Sign In to add comment