Coding language: C++. (Try to avoid linked lists if possible please). Add comments. Thanks. • Each functionality component must be implemented as a separate function, though the function does not need to be declared and defined separately • No global variables are allowed • No separate.hor.hpp are allowed • You may not use any of the hash tables, or hashing functions provided by the STL or Boost library to implement your hash table • Appropriate, informative messages must be provided for prompts and outputs You must implement a hash table using the Double Hashing collision strategy and the mid-square base 10 hashing function with an R of 2. Your collision strategy must be implemented as a separate function, though it may be implemented inside your insert/search/delete functions, and should halt an insert / search/delete functions, and should halt an insert/search/delete after table size number of collisions. Your hash function must be implemented as a separate function. Your hash table must store positive integers and contain 20 buckets. No global declarations. Functionality Your int main must have the menu allowing the user to choose between inserting, searching, deleting, and outputting the integers in your hash table. The user should be able to insert, search, delete, and output as many times as they wish. There should be an option to end the program. (Hint: enum/switch may be used). Insert a user specified integer If an insert is rejected due to the collision strategy halting, the function should output that the insert was rejected. Search for the first instance of a user specified integer If found, output that the integer exists upon finding the first instance of the integer. If the collision strategy halts, the function should output that the integer does not exist. No error checking required. Delete the first instance of a user specified integer If the desired integer is found, the function should tombstone the integer’s slot in the hash table, and report that the integer was deleted. If the collision strategy halts, the function should output that the integer does not exist. No error checking required Output all integers in the hash table starting at index 0 along with their index
Coding language: C++. (Try to avoid linked lists if possible please). Add comments. Thanks.
• Each functionality component must be implemented as a separate function, though the function does not need to be declared and defined separately
• No global variables are allowed
• No separate.hor.hpp are allowed
• You may not use any of the hash tables, or hashing functions provided by the STL or Boost library to implement your hash table
• Appropriate, informative messages must be provided for prompts and outputs
You must implement a hash table using the Double Hashing collision strategy and the mid-square base 10 hashing function with an R of 2. Your collision strategy must be implemented as a separate function, though it may be implemented inside your insert/search/delete functions, and should halt an insert / search/delete functions, and should halt an insert/search/delete after table size number of collisions. Your hash function must be implemented as a separate function. Your hash table must store positive integers and contain 20 buckets. No global declarations.
Functionality
- Your int main must have the menu allowing the user to choose between inserting, searching, deleting, and outputting the integers in your hash table. The user should be able to insert, search, delete, and output as many times as they wish. There should be an option to end the program. (Hint: enum/switch may be used).
- Insert a user specified integer
- If an insert is rejected due to the collision strategy halting, the function should output that the insert was rejected.
- Search for the first instance of a user specified integer
- If found, output that the integer exists upon finding the first instance of the integer.
- If the collision strategy halts, the function should output that the integer does not exist.
- No error checking required.
- Delete the first instance of a user specified integer
- If the desired integer is found, the function should tombstone the integer’s slot in the hash table, and report that the integer was deleted.
- If the collision strategy halts, the function should output that the integer does not exist.
- No error checking required
- Output all integers in the hash table starting at index 0 along with their index
Trending now
This is a popular solution!
Step by step
Solved in 3 steps with 1 images