HI
I am trying to find out the total number of recoreds in a Hash Table.
I am trying to write a function to calculate the total number of the recored in the Hash Table
here is what I figure out, but I am confused now ( my code in incomplete)
would you please guid me?
Thanks
I am trying to find out the total number of recoreds in a Hash Table.
I am trying to write a function to calculate the total number of the recored in the Hash Table
here is what I figure out, but I am confused now ( my code in incomplete)
would you please guid me?
Thanks
Code:
template <typename T,typename K>
int HashTable<T,K>::countRecords(HashTable<T,K> myHash){ //The number of records in the table: countRecords()
int num_recored=0;
T temp;
for(int i=0; i<myHash.table.size(); i++)
if(myHash.table[i].size()>1)
for(int j=0; j<myHash.table[i][j].size(); j++){
}
if(myHash.table[i][j]!=myHash.table[i][j+1]){ //check for error
num_record++;
}
num_record++;
return num_record;
}
Comment