[Cs3] note on hashing lab

Mikhail Nesterenko mikhail at cs.kent.edu
Wed Oct 12 17:10:30 EDT 2016


cs3 students,

Note that for the rehash() function, you will need to update the
number of buckets stored in the object that computes the hashed value
of the key.

Also, just some clarification on the code. In the implementation of
the overloaded indexing operator. In the following line:

 insert(make_pair(x, Value()));

Value is the type parameter substituted by actual type. For example
"int".

Now, in c++ there is a difference between 

     int and int()

The first potentially allows no constructor (and leaves the variable
(or object) in arbitrary state), the second explicitly invokes default
constructor. 

Thanks,
-- 
Mikhail


More information about the cs3 mailing list