data structure stores a set of items and provides as central functions the insertion of a new item, the search for an item, and the deletion of an item.
#include <hash.h>
Inheritance diagram for ABA_HASH< KeyType, ItemType >::
|
Initializes each slot with a 0-pointer to indicate that the linked list of hash items of this slot is empty.
The destructor deletes for each hash item by going through all non-empty lists of hash items.
Performs a regular insert() if there is no item with the same key in the hash table, otherwise the item is replaced by the new item.
This version of the function find() checks if a prespecified item with a prespecified key is contained in the hash table.
This version of the function remove() removes the first item with a given key and a prespecified element from the hash table.
The functions initializeIteration() and next() can be used to iterate through all items stored in the hash table having the same key.
The function next() can be used to go to the next item in the hash table with key key.
This version of hf() implements a Fibonacci hash function for keys of type unsigned.
The output operator writes row by row all elements stored in the list associated with a slot on an output stream.
data structure stores a set of items and provides as central functions the insertion of a new item, the search for an item, and the deletion of an item.
Definition at line 137 of file hash.h.
Initializes each slot with a 0-pointer to indicate that the linked list of hash items of this slot is empty.
The destructor deletes for each hash item by going through all non-empty lists of hash items.
Adds an item to the hash table.
The new item is inserted at the head of the list in the corresponding slot. It is possible to insert several items with the same key into the hash table.
Performs a regular insert() if there is no item with the same key in the hash table, otherwise the item is replaced by the new item.
Looks for an item in the hash table with a given key.
A pointer to an item with the given key, or a 0-pointer if there is no item with this key in the hash table. If there is more than one item in the hash table with this key, a pointer to the first item found is returned.
This version of the function find() checks if a prespecified item with a prespecified key is contained in the hash table.
true If there is an element (key, item) in the hash table,
false otherwise.
The function initializeIteration() retrieves the first item.
A pointer to the first item found in the hash table having key key, or 0 if there is no such item.
The function next() can be used to go to the next item in the hash table with key key.
Before the first call of next() for a certain can the iteration has to be initialized by calling initializeItaration().
The function next() gives you the next item having key key but not the next item in the linked list starting in a slot of the hash table.
A pointer to the next item having key key, or 0 if there is no more item with this key in the hash table.
Removes the first item with a given key from the hash table.
0 If an item with the key is found.
1 If there is no item with this key.
This version of the function remove() removes the first item with a given key and a prespecified element from the hash table.
0 If an item with the key is found.
1 If there is no item with this key.
The length of the hash table.
The number of collisions which occurred during all previous calls of the functions insert() and overWrite().
Can be used to change the size of the hash table.
Computes the hash value of key.
It must be overloaded for all key types, which are used together with this template.
This following version of hf() implements a Fibonacci hash function for keys of type int.
This version of hf() implements a Fibonacci hash function for keys of type unsigned.
This is a hash function for character strings.
It is taken from Knu93a}, page 300.
The output operator writes row by row all elements stored in the list associated with a slot on an output stream.
The output of an empty slot is suppressed.
A reference to the output stream.
A pointer to the corresponding global object.
Definition at line 331 of file hash.h.
The hash table storing a linked list of hash items in each slot.
table_[i] is initialized with a 0-pointer in order to indicate that it is empty. The linked lists of each slot are terminated with a 0-pointer, too.
Definition at line 339 of file hash.h.
The length of the hash table.
Definition at line 343 of file hash.h.
The number of collisions on calls of insert() and overWrite().
Definition at line 347 of file hash.h.
An iterator for all items stored in a slot.
This variable is initialized by calling initializeIteration() and incremented by the function next().
Definition at line 355 of file hash.h.
The documentation for this class was generated from the following file: