Rehashing implementation

sir, can u pls explain me , how previously used memory is deleted.

first we rename our table to oldtable and then make new table
then we take all elements from oldtable one by one and inset into new table
when we insert complete list corresponding to a key then we delete this list using destructor we write
delete oldtable[i]
this we intiate destructor call with head of list to and in destructor we have written
if(temp->next!=NULL) delete next;
so this delete next first
in this way we delete recursively all elements of list using destructor

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.