Replies To: c++ Hash Table collision and count

Re: c++ Hash Table collision and count

Hi there guys. I don't know what should I do for:
-counting number of elements from table
-in case of collision, adding node at the end of the table
I have here the source codes:

Although you have not supplied table.cpp, it looks like the size member variable is to be used for the count of elements. When elements are added the size is changed etc.

You have two options, I think, for adding at the end of the table. You can write a function to append to the table, or a less efficient option : create a new and larger table and copy the data over(edit : probably not a great idea).

Edit: looking again another option could be just to add new NODE's as in a tree or create a new table.