ADS
Algorithms and Data Structures
Loading...
Searching...
No Matches
DirectTable.h File Reference

The table with direct access of chapter 7: when the keys are the integers in an interval \( [ a , b ] \) of size \( m \), the function \( H( k ) = k - a \) is injective, a perfect hash, and the DICTIONARY [see ADT.h] is a vector of size \( m \), every operation in \( O( 1 ) \) time. More...

#include "ADS/Contract.h"
#include "ADS/Iterators.h"
#include <cstddef>
#include <limits>
#include <optional>
#include <utility>
#include <vector>
#include "ADS/dictionary/impl/DirectTable.tpp"

Go to the source code of this file.

Classes

class  ADS::DirectTable< V >
 the table with direct access of the keys in \( [ a , b ] \), \( H( k ) = k - a \): every operation in \( O( 1 ) \) time, \( b - a + 1 \) places of memory More...
struct  ADS::DirectTable< V >::Places
 the places of the table, for SlotIterator More...

Namespaces

namespace  ADS

Detailed description

The table with direct access of chapter 7: when the keys are the integers in an interval \( [ a , b ] \) of size \( m \), the function \( H( k ) = k - a \) is injective, a perfect hash, and the DICTIONARY [see ADT.h] is a vector of size \( m \), every operation in \( O( 1 ) \) time.

The contracts [see Contract.h]: \( a \le b \) with \( b - a + 1 \) places that fit in a std::size_t, and every key in \( [ a , b ] \), checked without overflow for any long; the invariant is that size() counts the places that are not empty. The operations are defined in DirectTable.tpp.

See also
A. Montresor, Algoritmi e Strutture Dati, 2025, chapter 7, https://algoritmicamente.it/materiali/libro/capitoli/cap07.pdf
Author
Donato Meoli
Dipartimento di Informatica
Università di Pisa