Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

C++ Use double hashing to reimplement the hash table. The table1.h has been provided. Test your program in main(). //table1.h #ifndef TABLE1_H #define TABLE1_H #include

C++

Use double hashing to reimplement the hash table. The table1.h has been provided. Test your program in main().

//table1.h #ifndef TABLE1_H #define TABLE1_H #include // Provides size_t

namespace main_savitch_12A { template class table { public: // MEMBER CONSTANT -- See Appendix E if this fails to compile. static const std::size_t CAPACITY = 811; // CONSTRUCTOR table( ); // MODIFICATION MEMBER FUNCTIONS void insert(const RecordType& entry); void remove(int key); // CONSTANT MEMBER FUNCTIONS bool is_present(int key) const; void find(int key, bool& found, RecordType& result) const; std::size_t size( ) const { return used; } private: // MEMBER CONSTANTS -- These are used in the key field of special records. static const int NEVER_USED = -1; static const int PREVIOUSLY_USED = -2; // MEMBER VARIABLES RecordType data[CAPACITY]; std::size_t used; // HELPER FUNCTIONS std::size_t hash(int key) const; std::size_t next_index(std::size_t index) const; void find_index(int key, bool& found, std::size_t& index) const; bool never_used(std::size_t index) const; bool is_vacant(std::size_t index) const; }; } #include "table1.template" // Include the implementation. #endif

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Essential SQLAlchemy Mapping Python To Databases

Authors: Myers, Jason Myers

2nd Edition

1491916567, 9781491916568

More Books

Students also viewed these Databases questions

Question

"The economy's in equilibrium!" Is that necessarily good?

Answered: 1 week ago

Question

What is the current days sales outstanding KPI value for 2020?

Answered: 1 week ago