-
Here, E specifies the type of objects that the set will hold.
-
As most people likely know, a hash table stores information by using a mechanism called hashing.
-
In hashing, the informational content of a key is used to determine a unique value, called its hash code.
-
The hash code is then used as the index at which the data associated with the key is stored. The transformation of the key into its hash code is performed automatically— you never see the hash code itself.
-
Also, your code can’t directly index the hash table.
-
The advantage of hashing is that it allows the execution time of add( ), contains( ), remove( ), and size( ) to remain constant even for large sets.