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.

include <iostream>

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){

};

I have yet to finish the quadratic insert function, but is everything up until that point ok?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.