55 Entry(
unsigned long k,
unsigned long v)
73 const unsigned long numNodes = 10000;
79 unsigned int t = std::time(
NULL);
84 n = std::stoul(
argv[1]);
87 t = std::stoul(
argv[2]);
96 cout <<
"n must be positive" <<
endl;
102 cout <<
"testDynamicHash " << n <<
" " << t <<
endl;
111 cout <<
"Inserting..." <<
endl;
113 for (i = 0; i < n; i++)
121 cout <<
value <<
" ";
133 cout <<
endl <<
"Searching..." <<
endl;
135 for (i = 0; i < n; i++)
141 cout <<
endl <<
"Error key " <<
keys[i] <<
" not found" <<
endl;
146 cout <<
"Testing iterator" <<
endl;
152 cout << it.get_curr()->get_key() <<
" ";
157 cout <<
endl <<
"testing deleting ..." <<
endl;
161 for (i = 0; i < n; i++)
171 AH_ERROR(
"%u th key %u not found\n", (
int) i, (
int)
keys[i]);
175 catch (exception&
exc)
177 cout <<
exc.what() <<
" exception has been thrown" <<
endl;
181 cout <<
" unknown exception has been thrown" <<
endl;
#define AH_ERROR(...)
Print an error message (always enabled).
Core header for the Aleph-w library.
size_t size_t int32_t value
bool has_curr() const noexcept
Return true if the iterator has current item.
Generic linear hash table.
const size_t & capacity() const noexcept
Returns the table capacity.
const size_t & size() const noexcept
Returns the number of elements in the table.
const size_t & expansions() const noexcept
Returns the expansion level performed on the table.
Bucket * remove(Bucket *bucket) noexcept
Remove bucket from table.
const size_t & busy_slots() const noexcept
Returns the number of busy slots in the table.
Bucket * insert(Bucket *bucket)
Insert bucket in the table.
Bucket * search(const Key &key) const noexcept
Search for key in the linear hash table.
size_t blossom_maximum_cardinality_matching(const GT &g, DynDlist< typename GT::Arc * > &matching, SA sa=SA())
Alias of compute_maximum_cardinality_general_matching().
Main namespace for Aleph-w library functions.
Itor::difference_type count(const Itor &beg, const Itor &end, const T &value)
Count elements equal to a value.
Entry(unsigned long k, unsigned long v)
void print_stats(LinearHashTableVtl< unsigned long > &table)
Linear hashing with chaining.