|
|
void | set_hash_fct (Hash_Fct fct) noexcept |
| | Set the internal hash function.
|
| |
|
void | set_hash_fct (Hash_Fct_Ptr fct) noexcept |
| |
|
Hash_Fct | get_hash_fct () const noexcept |
| |
|
Cmp & | get_compare () noexcept |
| |
|
const Cmp & | get_compare () const noexcept |
| |
|
float | current_alpha () const noexcept |
| | return the current table load
|
| |
| | GenLinearHashTable (size_t len=Primes::DefaultPrime, Hash_Fct_Ptr hash_fct=Aleph::dft_hash_fct< Key >, Cmp cmp=Cmp(), float lower_alpha=hash_default_lower_alpha, float upper_alpha=hash_default_upper_alpha, bool remove_all_buckets=true, bool with_resize=true) |
| |
|
void | swap (GenLinearHashTable &other) noexcept |
| |
| void | empty () noexcept |
| |
| Bucket * | search (const Key &key) const noexcept |
| |
|
const size_t & | size () const noexcept |
| | Retorna la cantidad de elementos que tiene la tabla.
|
| |
|
bool | is_empty () const noexcept |
| | return true is table is empty
|
| |
|
const size_t & | capacity () const noexcept |
| | Retorna el tamaño de la tabla.
|
| |
|
const size_t & | busy_slots () const noexcept |
| | Retorna la cantidad de entradas vacÃa que tiene la tabla.
|
| |
| const size_t & | expansions () const noexcept |
| |
| Bucket * | insert (Bucket *bucket) |
| |
|
Bucket * | search_or_insert (Bucket *bucket) |
| |
|
size_t | resize (size_t) noexcept |
| | Provided for generic programming compatibility.
|
| |
| Bucket * | remove (Bucket *bucket) noexcept |
| |
|
void | print () |
| |
|
Stats | stats () const |
| |
|
void | print_stats (const Stats &stats) const |
| |
|
void | set_upper_alpha (const float &__upper_alpha) |
| |
|
void | set_lower_alpha (const float &__lower_alpha) |
| |
|
float | get_lower_alpha () const noexcept |
| |
|
float | get_upper_alpha () const noexcept |
| |
template<typename Key, template< class > class BucketType, class Cmp = Aleph::equal_to<Key>>
class Aleph::GenLinearHashTable< Key, BucketType, Cmp >
Tabla hash lineal genérica.
Básicamente, una tabla hash lineal es una tabla hash con resolución de colisiones por encadenamiento separado pero con la diferencia de que el tamaño de la tabla aumenta dinámicamente para asegurar que el factor de carga, tÃpicamente llamado
, esté delimitado entre dos valores inferior y superior, respectivamente.
Internamente, la tabla utiliza un arreglo dinámico del tipo DynArray. Esto conlleva ahorros de memoria por entradas de la tabla que no hayan sido escritas.
Este tipo es genérico y no está destinado a usarse. En su lugar, utilÃcese LinearHashTable o LinearHashTableVtl según se desee utilizar cubetas sin o con destructor virtual.
- Parameters
-
| Key | el tipo de clave por el cual se indiza la tabla. |
| BucketType | el tipo de cubeta entre LinHashBucket o LinHashBucketVtl. |
| Cmp | clase de comparación entre las claves. |
- See also
- DynArray LinearHashTable LinearHashTableVtl