Assume you have access to a magical function called magicHash that takes in a string and outputs a unique number with no collisions, Using this magical function, complete the below implementation of MyHashSet, which will store strings. Specifically, you should have a constructor, a working add() method, and a working contains() method. The add and contains() methods must have a worst-case running time in O(1). You can assume that the hash set will never need to hold more than 1,000 strings. You may use any libraries except for HashSet.

Solved
Show answers

Ask an AI advisor a question