Storage mechanism using linear probing hash keys.
More...
#include <iostream>
#include <vector>
|
|
using | linear_probing::Entry = struct Entry |
| |
|
|
int | linear_probing::notPresent |
| |
|
std::vector< Entry > | linear_probing::table |
| |
|
int | linear_probing::totalSize |
| |
|
int | linear_probing::tomb = -1 |
| |
|
int | linear_probing::size |
| |
|
bool | linear_probing::rehashing |
| |
Storage mechanism using linear probing hash keys.
- Author
- achance6
-
Krishna Vedala
- Note
- The implementation can be optimized by using OOP style.
◆ main()
Main function
- Returns
- 0 on success
225 int cmd = 0, hash = 0, key = 0;
226 std::cout <<
"Enter the initial size of Hash Table. = ";
255 if (entry.
key == linear_probing::notPresent) {
261 std::cout <<
"Enter element to generate hash = ";
void addInfo(int key)
Definition: linear_probing_hash_table.cpp:186
size_t hashFxn(int key)
Hash a key. Uses the STL library's std::hash() function.
Definition: linear_probing_hash_table.cpp:46
int linearProbe(int key, bool searching)
Definition: linear_probing_hash_table.cpp:55
void removalInfo(int key)
Definition: linear_probing_hash_table.cpp:201
void display()
Definition: linear_probing_hash_table.cpp:120
Definition: linear_probing_hash_table.cpp:35
int key
key value
Definition: linear_probing_hash_table.cpp:37