|
ADS
Algorithms and Data Structures
|
The bag of exercise 1.5 of Morin's book, beyond the book. More...
Files | |
| file | ADS/set/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. | |
Classes | |
| class | ADS::Bag< T, H, Eq > |
| a USet that keeps the items equal to one another, on a hash table of groups More... | |
The bag of exercise 1.5 of Morin's book, beyond the book.
The definitions, the invariants and the costs of the area are in Theory of sets.