定义函数如下 :
void insert(char* key)
{
for(size_t i = 0; i < hash_function.size(); i++)
{
unsigned int hash = hash_function[i](key,4) % (table_size * 8);
hash_table[hash / char_size] |= bit_mask[hash % char_size];
}
}
main中该如何调用,insert的参数要如何写?
int main(int argc, char* argv[])
{
std::vector<std::string> word_list;
read_file("word-list.txt",word_list);
bloom_filter filter(word_list.size() * 32);
for(unsigned int i = 0; i < word_list.size(); i++)
{
filter.insert(word_list[i]);
}
}
void insert( const std::string& key );