Hashtable class implementation

why do we need to make the destructor here ?

Destructors in C++ are members functions in a class that delete an object. They are called when the class object goes out of scope such as when the function ends, the program ends, a delete variable is called etc.
So a destructor should always be present to dereference the memory after a program ends.