ADS
Algorithms and Data Structures
Loading...
Searching...
No Matches
dictionary Directory Reference

Files

 
AdaptiveRadixTree.h
 The adaptive radix tree of Leis, Kemper and Neumann on strings, beyond the book: the engineered ordered DICTIONARY of ADS [see ADT.h] whose keys are strings, the one that the benchmark of the tries compares with the HAT-trie of tsl, with libart and with the B-trees of strings, while Trie and RadixTree [see Trie.h] stay the tries of Fredkin and of Morrison.
 
BinaryTrie.h
 The binary tries of the integers of \( w \) bits, beyond the book: a SORTED SET of keys \( x \in \{ 0 , \ldots , 2^w - 1 \} \), each with a value, in which lowerBound( x ) gives the smallest key \( \ge x \) (the successor, the find( x ) of the SSet of Morin's book), in time that depends on \( w \) and not on the number \( n \) of keys.
 
BitmapTrie.h
 The trie of exercise 13.3 of Morin's book, beyond the book: a SORTED SET of strings of any length, each with a value, whose lowerBound( s ) (the smallest string \( \ge s \) in the lexicographic order of the bytes, a prefix before its extensions), insert( s ) and remove( s ) take \( O( |s| ) \) time, whatever the number of strings.
 
BucketCuckooTable.h
 The cuckoo hashing with buckets of 4 places and a search in breadth of Li, Andersen, Kaminsky and Freedman (the table of MemC3 and libcuckoo), beyond the book: the engineered cuckoo table of ADS [see CuckooHashing.h for the cuckoo hashing of Pagh and Rodler, one key per place].
 
ChainedHashTable.h
 The hash table with lists of overflow of section 7.2.1, a realization of the DICTIONARY [see ADT.h]: the place \( i \) of a vector of size \( m \) holds a LIST with the pairs whose keys have \( H( k ) = i \), insert() puts a new key at the head of its list, lookup() and remove() go along it.
 
CuckooHashing.h
 The cuckoo hashing of Pagh and Rodler, beyond the book: each key \( k \) is in one of the two places \( h_1( k ) \) and \( h_2( k ) \) of a table of \( m \) places, so that a search and a removal look at two places, \( O( 1 ) \) time in the worst case.
 
DenseHashMap.h
 A hash map whose pairs lie in a dense vector, beyond the book: the pairs \( ( \mathit{key} , \mathit{value} ) \) are the elements \( 0 , \ldots , n - 1 \) of a vector, in the order of their insertions up to the removals, and a separate index of open addressing maps a key to the position of its pair in the vector.
 
DirectTable.h
 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.
 
FastHash.h
 The engineered hash functions of ADS, beyond the book [see HashFunctions.h for those of section 7.1 and UniversalHashing.h for the universal classes]: hashes of 64 bits for the tables, the filters and the perfect hash functions, made of the folded product, the product of two words on 128 bits whose two halves are XORed [see foldedProduct()].
 
FingerprintPerfectHash.h
 The minimal perfect hash function by fingerprinting, beyond the book: the method of Müller, Sanders, Schulze and Zhou, engineered as BBHash by Limasset et al. and as FMPH by Beling, a function that maps the \( n \) distinct keys of a static set \( S \) onto \( \{ 0 , \ldots , n - 1 \} \) in about \( \gamma e^{1 / \gamma} \) bits per key, built in a few passes over the keys [see MinimalPerfectHash.h for the function by pilots, fewer bits and faster queries but a slower build, and RecSplit.h for the fewest bits].
 
FlatHashTable.h
 A hash table with open addressing and control bytes, beyond the book: the engineered DICTIONARY of ADS [see ADT.h], the one that the benchmark of the dictionaries compares with boost::unordered_flat_map, while OpenHashTable [see OpenHashTable.h] stays the table of section 7.2.2.
 
HashFunctions.h
 The hash functions of section 7.1.
 
IndexedSkipList.h
 The indexed skip list, beyond the book: the skip list of Pugh [see SkipList.h] whose links carry their width, the number of keys they jump over, so that besides the operations of a DICTIONARY [see ADT.h] and the find(x) of an SSet of Morin (lowerBound()) it reaches a key by its rank, the number of keys smaller than it, and gives the rank of a key, both in \( O( \log n ) \) expected time (exercise 4.9 of Morin).
 
KnuthHashing.h
 Two hash tables of Knuth, beyond the book [see ChainedHashTable.h and OpenHashTable.h for those of chapter 7], both without removal:
 
MinimalPerfectHash.h
 The minimal perfect hash function of ADS by pilots, the method of PTHash of Pibiri and Trani, beyond the book [see PerfectHashing.h for the schemes of Fredman, Komlós and Szemerédi and of Czech, Havas and Majewski]: a function that maps the \( n \) distinct keys of a static set \( S \) onto \( \{ 0 , \ldots , n - 1 \} \) with no collision, in a few bits per key (about 3 for the default parameters) and with two accesses to memory per evaluation.
 
OpenHashTable.h
 The hash table with open addressing of section 7.2.2, a realization of the DICTIONARY [see ADT.h].
 
PatriciaTrie.h
 The Patricia trie with the blind search of Ferragina and Grossi, beyond the book: the compacted trie of a sorted dictionary of \( n \) strings [see RadixTree in Trie.h, whose edges keep their whole labels] stripped of the labels, each edge keeping only its first character (the branching one) and each node the length of the prefix it stands for, so that it takes \( O( n ) \) space whatever the length of the strings, which are stored apart (e.g., on disk).
 
PerfectHashing.h
 Perfect hashing of a static set, beyond the book: a function is perfect on a set \( S \) of \( n \) keys if it has no collision on \( S \), minimal if its range is \( \{ 0 , \ldots , n - 1 \} \), and order preserving if it maps the keys in their order; a table built on it searches in \( O( 1 ) \) time in the worst case, as the table with direct access [see DirectTable.h], but in \( O( n ) \) space instead of the size of the universe.
 
PointerTable.h
 A hash table of pointers with open addressing, beyond the book: the set of the objects of a search (its closed list), each found from its key, e.g., the state of a node.
 
PositionIndex.h
 The index of the positions of objects in a vector, beyond the book: a hash table from the address of an object to its position, of 32 bits, in a vector that holds it, e.g., the constraints or the variables of a model, whose positions change when some of them are erased.
 
RandomHashing.h
 Hashing with random tables, beyond the book:
 
RecSplit.h
 The minimal perfect hash function of ADS by recursive splitting, the RecSplit of Esposito, Mueller Graf and Vigna, beyond the book [see MinimalPerfectHash.h for the one by pilots, faster but about 3 bits per key]: a function that maps the \( n \) distinct keys of a static set \( S \) onto \( \{ 0 , \ldots , n - 1 \} \) with no collision in about 1.8 bits per key for the leaves of 8 keys and the buckets of 100, against the lower bound of \( \log_2 e \approx 1.4427 \) bits per key of any minimal perfect hash function.
 
RowFingerprint.h
 The fingerprints of the rows of doubles, beyond the book: a hash of 64 bits of a dense row \( ( x_0 , \dots , x_{n-1} ) \) or of a sparse one, its indices and values \( ( j_k , v_k ) \) in their order, for finding the rows already seen, e.g., a cut generated twice, by a table of the fingerprints; sameRow() then tells whether two rows with the same fingerprint are really equal.
 
SkipList.h
 The skip list of Pugh, beyond the book: a sorted list of the keys with express lanes, each node being in the levels 0 to \( L - 1 \), \( L \) drawn with probability \( 2^{-L} \), and each level a sorted list of its nodes; a search goes along the highest level and drops a level before passing the key, in \( O( \log n ) \) expected time, and an insertion or a removal links or unlinks the node on its levels.
 
SortedArrayDictionary.h
 A DICTIONARY [see ADT.h] realized with a vector of the pairs \( ( \mathit{key} , \mathit{value} ) \) sorted by key, beyond the book: lookup() is the binary search of section 1.2 [see BinarySearch.h], in \( O( \log n ) \) time, while insert() and remove() move the pairs after the place of the key, in \( O( n ) \).
 
SuccinctPatriciaTrie.h
 The Patricia trie of a static dictionary of strings in succinct space, beyond the book: the compacted trie of the strings [see PatriciaTrie.h for the trie with pointers] coded by the degrees of its nodes in depth (DFUDS) of Benoit, Demaine, Munro, Raman, Raman and Rao, with the first character of each edge in a byte and the rest of its label in a string apart, and a string mapped to its rank in the lexicographic order (see Ordered dictionaries and tries).
 
TableSize.h
 The sizes of the hash tables that restructure themselves (section 7.4): a size that is a power of two doubles or halves, any other one goes to the first prime not smaller than its double or its half, so that the inspections of an OpenHashTable that need a prime size, or a size coprime with their step, keep working.
 
Trie.h
 Two digital search trees of strings, beyond the book:
 
TwoLevelDictionary.h
 The two-level dictionary of strings, beyond the book: the lower level is the front coding of the sorted strings with anchors [see FrontCodedDictionary in FrontCoding.h], the strings that are stored whole, either one every \( b \) (the bucketing) or as the locality-preserving coding decides, and the upper level a Patricia trie [see PatriciaTrie.h] on the anchors alone.
 
UniversalHashing.h
 Universal hashing, beyond the book [see HashFunctions.h for the fixed functions of section 7.1]: a class \( H \) of functions \( U \rightarrow \{ 0 , \ldots , m - 1 \} \) is universal if two distinct keys collide under at most \( | H | / m \) of its functions, and \( c \)-universal if under at most \( c | H | / m \); a function drawn at random from it gives every set of keys the expected lists of length \( 1 + \alpha \) of the simple uniform hashing, \( \alpha = n / m \), and the longest of them is \( O( \log n / \log \log n ) \) in expectation when \( m = \Theta( n ) \), whatever the keys, while for every fixed function there are \( n \) keys that fall in one list.
 
XFastTrie.h
 The x-fast tries of Willard, beyond the book: SORTED SETs of the integers of \( w \) bits, each with a value, in which lowerBound( x ) gives the smallest key \( \ge x \) (the find( x ) of the SSet of Morin's book) in \( O( \log w ) \) expected time.
 
YFastTrie.h
 The y-fast trie of Willard, beyond the book, in the form of section 13.3 of Morin's book: a SORTED SET of the integers of \( w \) bits, each with a value, in \( O( n ) \) space, whose lowerBound( x ) (the smallest key \( \ge x \), the find( x ) of the SSet of the book), insert() and remove() take \( O( \log w ) \) expected time, the last two amortized.