天天看點

Design HashSet

design a hashset without using any built-in hash table libraries.

to be specific, your design should include these functions:

<code>add(value)</code>: insert a value into the hashset. 

<code>contains(value)</code> : return whether the value exists in the hashset or not.

<code>remove(value)</code>: remove a value in the hashset. if the value does not exist in the hashset, do nothing.

example:

繼續閱讀