// ***************************************************************** // Author: Zhixiang Chen // Class: CSCI/CMPE 3333, Fall 2014 // Lab 4: Hashing, separate chaining // Date: 08/2014 // Comment: The code here is meant to be revised. //----------------------------------------------------------------- // Description: This program is to implement a generic hash table with // open addressing techniques to resolve collisions. // ***************************************************************** #include #include #include #include #include #include "lab3333_4_head.h" using namespace std; int main() { /********************************************************** Part A: Some practice Note: Three open addressing types are defined: For linear probing, Tag = LINEAR_PROBING, For quadratic, Tag = QUADRATIC_PROBING, For double hashing, Tag = DOUBLE_HASHING **********************************************************/ //pratice integer hash table int S = 10; hashTableType ht(S); int num, i, j, N=20; bool tag; //load the table srand(time(0)); for (i=0; i<15; i++) { num = 2 + rand()%100; ht.insert(num); } //print hash table cout<<" table size = " << ht.getTableSize()<>num; tag = ht.search(num); if (tag) { cout<<" found " <