Skip to content

Latest commit

 

History

History
32 lines (22 loc) · 725 Bytes

File metadata and controls

32 lines (22 loc) · 725 Bytes

Hash table implementation using separate chaining

Public functions

  // Constructor to initialize the hash table with a default size
  HashTable();

  // Destructor to clean up memory
  ~HashTable();

  // Copy constructor
  HashTable(const HashTable &other);

  // Assignment operator
  HashTable &operator=(const HashTable &other);

  // Get the current size of the hash table
  int size() const;

  // Calculate the load factor of the hash table
  double load_factor() const;

  // Insert a key-value pair into the hash table
  void insert(int key, int value);

  // Retrieve a value by key from the hash table
  int get(int key);

  // Remove a key-value pair from the hash table
  void remove(int key);