/*
* HashTable.h
*
* Created on: Nov 19, 2015
* Author: chris
*/
#pragma once
#include <iostream>
const int numofsizes = 7;
const int hashsize[] = { 11, 19, 31, 41, 53, 61, 71 };
typedef int KeyType;
typedef int ElemType;
struct HashCell{
bool null_key;
KeyType key;
HashCell() : null_key(true), key(0) {}
};
struct HashTable{
HashCell * cells;
int count;
int sizeindex;
};
bool HashTableInit(HashTable & H);
void HashTableDestroy(HashTable & H);
int HashTableHashKeyDirectAddr(HashTable & H, KeyType K);
bool HashTableSearchKey(HashTable & H, KeyType K, int& p, int& c);
bool HashTableInsertKey(HashTable & H, KeyType K);
bool HashTableDeleteKey(HashTable & H, KeyType K);
void HashTableDisplay(HashTable & H);
/*
* HashTable.cpp
*
* Created on: Nov 19, 2015
* Author: chris
*/
#