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

Files

 
Bag.h
 The bag of exercise 1.5 of Morin's book, beyond the book: a USet [see SetInterfaces.h] that keeps the items equal to one another, all of them: insert( x ) always adds \( x \), find( x ) gives one of the items equal to \( x \), findAll( x ) all of them, count( x ) how many, and remove( x ) removes the last one added, each in \( O( 1 ) \) expected time (amortized for insert() and remove(), which may rebuild the table) but findAll(), linear in what it gives.
 
BinaryFuseFilter.h
 The binary fuse filter of Graf and Lemire, beyond the book: a static filter of a set \( S \) of \( n \) keys, built once, which answers maybe for every key of \( S \) and for a key out of \( S \) with probability about \( 2^{-b} \), in about \( 1.13 b \) bits per key for fingerprints of \( b \) bits (8 or 16), against the \( 1.44 b \) of a filter of Bloom with the same false positives [see BloomFilter.h and BlockedBloomFilter.h] and the \( 1.23 b \) of the xor filter, of which it is the successor.
 
BlockedBloomFilter.h
 The blocked filter of Bloom, beyond the book: the engineered filter of ADS [see BloomFilter.h for the standard one and BloomVariants.h for its variants].
 
BloomFilter.h
 The filter of Bloom, beyond the book: a set that may answer yes for an item it does not hold, but never no for one it holds, in \( m \) bits whatever the items.
 
BloomVariants.h
 The variants and the analysis of the filter of Bloom [see BloomFilter.h for the standard one], beyond the book:
 
BoolSet.h
 The SET of the integers in \( [ 0 , N ) \) as a boolean vector of section 8.1: contains(), insert() and remove() in \( O( 1 ) \), min(), max() and forEach() in \( O( N ) \), union, intersection, difference and symmetric difference in \( \Theta( N ) \) (the first is called setUnion(), union being a keyword of C++, and so the others are setIntersection(), setDifference() and setSymmetricDifference()).
 
CuckooFilter.h
 The cuckoo filter of Fan, Andersen, Kaminsky and Mitzenmacher, beyond the book: a dynamic filter, which takes insertions and removals one at a time, of a set \( S \) of keys, answering maybe for every key of \( S \) and for a key out of \( S \) with a small probability.
 
DictionarySet.h
 The SET on any DICTIONARY with a foreach (sections 8.4 and 8.5): ChainedHashSet and OpenHashSet on the hash tables, contains(), insert() and remove() in \( O( 1 ) \) expected time and forEach() in \( O( m + n ) \) and \( O( m ) \), \( m \) the size of the table; TreeSet on a Red-Black tree, the three in \( O( \log n ) \) and forEach() in \( O( n ) \), in order.
 
GrafiteFilter.h
 The range filters of Costa, Ferragina and Vinciguerra, beyond the book: GrafiteFilter, a static filter of a set \( S \) of \( n \) keys that tells whether a range \( [ a , b ] \) of the universe may hold a key of \( S \) with a false positive probability that depends only on the length of the range, whatever the keys and the queries (adversarial ones included), and BucketingFilter, the heuristic of the same paper, faster and with no such guarantee.
 
HashMultiset.h
 The multiset on a hash table (exercise 8.10): a counter of occurrences per item, which the insertion of a new item sets to 1 and of an item already there increases by 1, and the removal decreases, removing the item at 0; each operation costs \( O( 1 ) \) expected time.
 
LinkedHashSet.h
 The SET on a hash table whose foreach follows the order of insertion (exercise 8.9): a LIST keeps the items in that order and the table maps each item to its position, so insert(), remove() and contains() take \( O( 1 ) \) expected time and forEach() \( O( n ) \).
 
ListSet.h
 The SET as an unsorted LIST of section 8.2: contains(), insert() and remove() in \( O( n ) \), insertNew() in \( O( 1 ) \) when the item is known to be absent, the operations of two sets in \( O( n m ) \), which is optimal when the items can only be compared for equality (exercises 8.1 and 8.2).
 
PrefixFilter.h
 The prefix filter of Even, Even and Morrison, beyond the book: an incremental filter, which takes insertions one at a time and no removals, of a set \( S \) of at most \( n \) keys, \( n \) known at its construction, answering maybe for every key of \( S \) and for a key out of \( S \) with a small probability.
 
RibbonFilter.h
 The standard Ribbon filter of Dillinger and Walzer, beyond the book: a static filter of a set \( S \) of \( n \) keys, built once, which answers maybe for every key of \( S \) and for a key out of \( S \) with probability about \( 2^{-r} \), for results of \( r \) bits (8 or 16, the type F), in \( r ( 1 + \varepsilon ) \) bits per key, \( \varepsilon \) a small overhead [see below], against the \( 1.44 r \) of a filter of Bloom with the same false positives [see BloomFilter.h] and the \( 1.125 r \) of the binary fuse filter at large \( n \) [see BinaryFuseFilter.h].
 
RoaringBitmap.h
 The compressed bitmap of Chambi, Lemire, Kaser and Godin (Roaring), beyond the book: a SET of integers of 32 bits [see ADT.h], the engineered counterpart of the boolean vector of section 8.1 [see BoolSet.h] for universes too large for a bit per integer and sets too dense for a sorted list [see VectorIntersection.h].
 
SetInterfaces.h
 The interfaces of chapter 1 of Morin's book for the sets, beyond the book, as concepts of C++20 [see ADT.h for the SET of the book], and their realizations on a vector that exercise 1.6 asks for, the oracles of the tests of the faster ones:
 
SetOperations.h
 The operations of chapter 8 on any SET that can be copied and has the foreach, forEach( f ): the union copies \( A \) and inserts the items of \( B \), the intersection copies the smaller set and removes its items not in the other one, the difference copies \( A \) and removes its items in \( B \), the symmetric difference adds to \( A \setminus B \) the items of \( B \) not in \( A \).
 
SortedIntersection.h
 The intersection of two sorted sets, the core of the resolution of a query of several words by an inverted index (Ferragina, chapter 6): \( A \) of \( n \) items and \( B \) of \( m \) items, strictly increasing, \( m \leq n \) (the roles are swapped otherwise).
 
SortedListSet.h
 The SET as a sorted LIST of section 8.3: insert() in \( O( n ) \), min() and max() in \( O( 1 ) \), the operations of two sets by merging the two lists in \( O( n + m ) \), optimal since merging needs \( \Omega( n + m ) \) (exercises 8.3 and 8.4).
 
SpaceEfficientSortedSet.h
 The space-efficient sorted set of Morin (his SESSet, exercise 4.13), beyond the book: a SET [see ADT.h] of ordered items and an SSet of Morin, with find() and lowerBound(), that stores \( n \) items in the space of \( n \) items plus \( O( n / b + b ) \) words, \( b \) a parameter.
 
VectorIntersection.h
 The engineered intersection of two sorted sets, beyond the book [see SortedIntersection.h for the algorithms of Ferragina, chapter 6, and SortedListSet.h for the merge of section 8.3]: intersect() writes the items common to \( A \) of \( n \) items and \( B \) of \( m \) items, both strictly increasing, into out, and gives their number.