// name
// date
// CS 303
// Linear Probing and Perfect Hash
//
// This program reads in strings from standard input and hashes them in a
// linear probing hash table and a perfect hash table.  Results from both
// hashing techniques are printed.


#include <vector>
#include <string>
#include <iostream>
#include <cmath>
#include "HashLin.hpp"
#include "HashPerfect.hpp"

using namespace std;

// function prototype find_next_prime (should be passed current size and return int)


int main ()

{
   vector<string> s;  // holds all input strings
   // declare any other needed variables here


   // prompt for input according to sample output

   // read in first input string to get input going; don't forget to echo print
   //  also declare input variable above
   cin >> str_input;
   cout << str_input << endl;

   // use while loop to input strings into vector (use push_back to automatically
   //  increase vector size during input; while loop should quit on "!"


   // linear hashing

   // find prime size of Linear Hash Table by calling your function

   // create hashlin table
   HashLin hashlin (prime_size);

   // insert all input strings into linear hash table
   for (index = 0; index < s.size (); index++) {

      hashlin.insert (s[index]);
   }

   // print linear hash table results
   cout << endl << endl;
   cout << "Hash Table with Linear Probing (size = " << prime_size
        << "): " << endl << endl;

   // call print method in hashlin

   // print 3 blank lines


   // perfect hashing

   // create hashperfect table
   HashPerfect hashperfect;

   // insert all input strings using one call to insert

   // print perfect hash table results

   cout << endl;
}


int find_next_prime (int size)

// write your own function here, or give reference to one found on the internet

