subject

Using Hash tables. Implement an unordered set. Implement an unordered set (a container for unique members) for integers in C++. It should support the following functions:void insert(val): Adds a value into the setbool has(val): Returns true if a value exists in the set, false otherwise. void rem(val): Removes a value from the set. If the value is not present, don't do anything. int size(): Returns the size of the setAll of these functions should be O(1) on average. Think about what was covered in class, specifically with hash function design and collision resolution protocols. Sample Input:get sizeinsert xget sizehas xinsert xget sizeremove xget sizehas xinsert 1-10000get sizeinsert 1-10000get sizehas 1-10000remove 1-10000get sizeSample Output:01true10falseCommencing stress test...10000100000CODE STRUCTURE:class unorderedSet {private:public:unorderedSet() {}void insert(int val) {}bool has(int val) {return false;}void rem(int val) {}int size() {return 0;}};

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 05:00
This program will store roster and rating information for a soccer team. coaches rate players during tryouts to ensure a balanced team. (1) prompt the user to input five pairs of numbers: a player's jersey number (0 - 99) and the player's rating (1 - 9). store the jersey numbers in one int vector and the ratings in another int vector. output these vectors (i.e., output the roster). (3 pts) ex: enter player 1's jersey number: 84 enter player 1's rating: 7 enter player 2's jersey number: 23 enter player 2's rating: 4 enter player 3's jersey number: 4 enter player 3's rating: 5 enter player 4's jersey number: 30 enter player 4's rating: 2
Answers: 1
question
Computers and Technology, 22.06.2019 13:00
Write a program which asks you to enter a name in the form of first middle initial last. so you might enter for example samuel p. clemens. use getline to read in the string because it contains spaces. also, apparently the shift key on your keyboard doesn’t work, because you enter it all lower case. pass the string to a function which uses .find to locate the letters which need to be upper case and use toupper to convert those characters to uppercase. the revised string should then be returned to main in the form last, first mi where it will be displayed.
Answers: 1
question
Computers and Technology, 22.06.2019 19:20
How might the success of your campaign be affected if you haven’t carefully completed all field data or if you accidentally insert the wrong merge field in the document?
Answers: 2
question
Computers and Technology, 24.06.2019 16:50
Ramp charts are generally created in wordlotusexcelpowerpoint
Answers: 1
You know the right answer?
Using Hash tables. Implement an unordered set. Implement an unordered set (a container for unique me...
Questions
question
Mathematics, 25.07.2020 07:01
question
English, 25.07.2020 07:01