I am trying to create a hash map and i do not know how to access entry from openAddressTable
1 2 3 4 5 6 7 8 9 10 11
typedefunsignedint unint;
//this bucket is used by the open addressing table
struct openBucket{
bool collision;//whether or not there was a collision at this field
string entry_;
};
class HashTables{
private:
std::unordered_map<unint,openBucket> openAddressTable;
}
int size = openAddressTable.size();
for (int i = 0; i < size; i++) {
if (openAddressTable[i].entry_==text) {
openAddressTable[i].collision = true;
i++;
}
}
So how do i create a new bucket?
1 2 3 4
else {
openAddressTable.insert = new openBucket;
openAddressTable[i].entry_ = text;
}