大数据处理算法之一 bloom filter 算法
#include #include #include using std::cout; using std::endl; inline static unsigned int GETBIT(char* vector, unsigned int pos) { unsigned int tmp = vector[pos / 8] & 1<<(7 - pos%8); return tmp; } inline static void SETBIT(char* vector, unsigned int pos) { vector[pos / 8] |= 1<<(7 - pos%8); } static unsigned int get_lines(const char* str) { FILE* fp; if( (fp = fopen(str,"r")) == NULL) {