35# define NumItems 10000
42static size_t hashFct(
const unsigned & key)
53 cout <<
"Resizing hash table from " <<
currSize <<
" ... ";
62 <<
"Num items = " << table.
size() <<
endl;
70 unsigned int t = std::time(
NULL);
75 n = std::stoi(
argv[1]);
78 t = std::stoi(
argv[2]);
87 cout <<
"n must be positive" <<
endl;
93 cout <<
argv[0] <<
" " << n <<
" " << t <<
endl;
100 for (i = 0; i < n/2; i++)
115 for (i = n/2; i < n; i++)
127 for (i = 0; i < n; i++)
Dynamic hash table mapping keys to records with separate chaining.
Record * search(const Key &key)
Search for a key in the table.
void remove(Record *record)
Remove an entry from the table.
Record * insert(const Key &key, const Record &record)
Insert a key-record pair into the table.
const size_t & get_num_busy_slots() const noexcept
Returns the number of occupied entries in the array.
const size_t & size() const noexcept
Returns the number of elements contained in the table.
const size_t & capacity() const noexcept
Returns the table capacity.
size_t resize(const size_t new_size)
Resizes the hash table to new_size and re-locates keys.
and
Check uniqueness with explicit hash + equality functors.
Divide_Conquer_DP_Result< Cost > divide_and_conquer_partition_dp(const size_t groups, const size_t n, Transition_Cost_Fn transition_cost, const Cost inf=dp_optimization_detail::default_inf< Cost >())
Optimize partition DP using divide-and-conquer optimization.
bool check_primes_database()
Verify the integrity of the prime database.
DynLhashTable< unsigned, unsigned > HTable
static size_t hashFct(const unsigned &key)
static void testResize(HTable &table)
static void printPars(const HTable &table)
Lazy and scalable dynamic array implementation.
Dynamic hash table mapping keys to records with separate chaining.