// ***************************************************************** // Author: Zhixiang Chen // Class: CSCI/CMPE 3333, Fall 2014 // Lab 3: 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 using // separate chaining to resolve collisions. // ***************************************************************** #include #include #include #include #include #include "lab3333_3_.h" using namespace std; int main() { /********************************************************** Part A: Some practice **********************************************************/ //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<40; i++) { num = rand()%100; j = hashInt(num, ht.getTableSize()); ht.insert(num); } //print hash table cout<<" table size = " << ht.getTableSize()<