Data Structures & Algorithms in C++
Goodrich, Tamassia, Mount and Goldwasser
|
#include <chain_hash_map.h>
Data Structures | |
class | iter_rep |
Public Member Functions | |
ChainHashMap () | |
Creates an empty map. | |
const_iterator | begin () const |
const_iterator | end () const |
![]() | |
int | size () const |
Returns the number of entries in the map. | |
const_iterator | find (const Key &k) const |
Returns a const_iterator to the entry with a given key, or end() if no such entry exists. | |
const_iterator | erase (const_iterator loc) |
Removes the entry indicated by the given iterator, and returns iterator to next entry in iteration order. | |
const_iterator | put (const Key &k, const Value &v) |
virtual const_iterator | begin () const=0 |
virtual const_iterator | end () const=0 |
![]() | |
bool | empty () const |
Returns true if the map is empty, false otherwise. | |
bool | contains (const Key &k) const |
Returns true if the map contains an entry with the given key. | |
const Value & | at (const Key &k) const |
bool | erase (const Key &k) |
virtual | ~AbstractMap () |
virtual int | size () const =0 |
virtual const_iterator | begin () const =0 |
virtual const_iterator | end () const =0 |
virtual const_iterator | find (const Key &k) const =0 |
virtual const_iterator | put (const Key &k, const Value &v)=0 |
virtual const_iterator | erase (const_iterator loc)=0 |
Protected Types | |
typedef AbstractHashMap< Key, Value, Hash > | Base |
typedef UnorderedListMap< Key, Value > | Bucket |
typedef Bucket::const_iterator | BCI |
![]() | |
typedef AbstractMap< Key, Value > | Base |
Protected Member Functions | |
void | create_table () |
const_iterator | bucket_find (int h, const Key &k) const |
const_iterator | bucket_put (int h, const Key &k, const Value &v) |
const_iterator | bucket_erase (int h, const_iterator loc) |
![]() | |
int | get_hash (const Key &k) const |
void | resize (int new_table_size) |
virtual void | create_table ()=0 |
virtual const_iterator | bucket_find (int h, const Key &k) const =0 |
virtual const_iterator | bucket_put (int h, const Key &k, const Value &v)=0 |
virtual const_iterator | bucket_erase (int h, const_iterator loc)=0 |
![]() | |
abstract_iter_rep * | get_rep (const_iterator iter) const |
void | update_value (const Entry &e, const Value &v) |
Protected Attributes | |
std::vector< Bucket > | table |
int | table_sz |
int | sz |
![]() | |
Hash | hash |
int | sz {0} |
int | table_sz {17} |
|
protected |
|
protected |
|
protected |
|
inline |
Creates an empty map.
|
inlinevirtual |
Reimplemented from dsac::map::AbstractHashMap< Key, Value, Hash >.
|
inlineprotectedvirtual |
Implements dsac::map::AbstractHashMap< Key, Value, Hash >.
|
inlineprotectedvirtual |
Implements dsac::map::AbstractHashMap< Key, Value, Hash >.
|
inlineprotectedvirtual |
Implements dsac::map::AbstractHashMap< Key, Value, Hash >.
|
inlineprotectedvirtual |
Implements dsac::map::AbstractHashMap< Key, Value, Hash >.
|
inlinevirtual |
Reimplemented from dsac::map::AbstractHashMap< Key, Value, Hash >.
|
protected |
|
protected |
|
protected |