Question: / / = = = = = = = = = = = = = = = = = = = = = = =

//============================================================================
// Hash Table class definition
//============================================================================
/**
* Define a class containing data members and methods to
* implement a hash table with chaining.
*/
class HashTable {
private:
// Define structures to hold bids
struct Node {
Bid bid;
unsigned int key;
Node *next;
// default constructor
Node(){
key = UINT_MAX;
next = nullptr;
}
// initialize with a bid
Node(Bid aBid) : Node(){
bid = aBid;
}
// initialize with a bid and a key
Node(Bid aBid, unsigned int aKey) : Node(aBid){
key = aKey;
}
};
vector nodes;
unsigned int tableSize = DEFAULT_SIZE;
unsigned int hash(int key);
public:
HashTable();
HashTable(unsigned int size);
virtual ~HashTable();
void Insert(Bid bid);
void PrintAll();
void Remove(string bidId);
Bid Search(string bidId);
size_t Size();
};

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!