Skip to content

Latest commit

 

History

History
24 lines (21 loc) · 1.02 KB

README.md

File metadata and controls

24 lines (21 loc) · 1.02 KB

HashTable

An implementation of the own Hash Table with Separate Chaining

Constructors:

  1. The default constructor.
  2. The constructor by begin-end iterators of std::pair<key, value> sequence.
  3. The constructor by a std::initializer_list of std::pair<key, value>. Сonstructors must support the ability to pass a hasher object of type Hash as the last argument. If it is not passed, the constructor by default is used.

Iterators:

Forward iterators: iterator addresses std::pair<const KeyType, ValueType>& and const_iterator addresses const std::pair<const KeyType, ValueType>&

Methods:

  1. size()
  2. empty()
  3. hash_function() returns hasher by value
  4. insert(std::pair<key, value>). If such key already exists, method does nothing
  5. eraser(key). If such key doesn't exist, method does nothing
  6. begin() for both iterator types
  7. end() for both iterator types
  8. find() for both iterator types
  9. operator []
  10. at(key). If such key doesn't exist, throw std::out_of_range
  11. clear()