// name
// date
// CS 303
// HashLin class
//
// This class implements hashing with linear probing.


#include <vector>
#include <string>
#include <iostream>

#include "HashLin.hpp"

using namespace std;


HashLin::HashLin (int size)

{
   // call method resize to set size

   // initialize all elements in hash table to empty string
   //  (look at the C++ slides for method to return size of vector)
}


int HashLin::hash (string el)

{
   // K&R hashing algorithm with Weiss' R value from slide 9

   int i;
   unsigned long hash = 0;


   for (i = 0; i < el.length(); i++) {

      hash = 37 * hash + el [i];
   }

   // return hash value that is within table size
}


bool HashLin::insert (string el)

{
   int index;
   int ct = 0;  // use ct to keep track of how many positions have been checked


   // call hash method to get index

   // start with index and try consecutive locations until empty slot is found
   // also need to check that ct does not exceed total entries in table, indicating
   //   that all locations have been checked and there is no room

   // write out message (see output samples) indicating full hash table if all
   //  locations have been tried; return failure

   // otherwise put el in hashTable

   // return success
}


// for HashLin printing, sometimes an indent is needed; pass the number of spaces
//  to indent (even if 0)
void HashLin::print (int indent)

{
   // use for loop to print out each hash table entry

      // indent if requested

      // print item

}

