Hey guys. I'm new to this site. I just wanted someone to look over the code I have so far for a hash table that operates on linear probing. I don't have anyone to really check these things for me as my professor is always busy. Can anyone tell me if there are any bugs, errors, typos, etc?
This code compiles, but has I think 2 warnings. Please give me some feedback if you have the chance. It would be much appreciated.
using namespace std;
const int tablesize=1001;
int lcounter=0;//# of linear probes
int qcounter=0;//# of quadratic probes
class HashTable
{
public:
int Table[tablesize];
HashTable(){
for(int i=0; i<1001; i++){
Table[i]=NULL;
}
}
void linearinsert(int key){
for(int stepsize = 1; stepsize<1001; stepsize++){
if(Table[key+stepsize%tablesize]==NULL){
++lcounter;
Table[key+stepsize%tablesize]==key;
}
if(Table[key+stepsize%tablesize]!=NULL){
++lcounter;
}
else{
cout<<"error, table is full";
}
}
}
void quadraticinsert(int key){
};