Skip to content

simone3c/hyperloglog

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Hyperloglog

Simple single-file C++ implementation of the Hyperloglog data structure

Basic usage

#include "hll.hpp"

int main(){

    // 10 bits are used for buckets
    Hll my_hll = Hll<10>();

    my_hll.insert(1);
    my_hll.insert(2);
    // ...

    // estimate of unique inserted elements
    double estimate = my_hll.count_unique();
}

To use the provided main file:

    > g++ main.cpp -std=c++20 -o my_hll
    > python3 gen_data.py <number of values to generate>
    > ./my_hll < data.txt

About

Simple C++ implementation of the Hyperloglog data structure

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published