Build your own CountMinSketch in Rust
While discussing about Counting Bloom Filter, we came across this function called estimated_count which attempts to calculate the number of times an element was present in the bloom filter. During the discussion, I also said that the Counting Bloom Filter is not the best datastructure for calculating the count of an item.\nCountMinSketch is a good data structure to do that. And we’ll see why.\nImagine you have created a Twitter-alternative and you would like to keep track of the frequency of all the hashtags so that you can derive the “heavy-hitters” or the top trending hashtags. Or you are building an e-commerce or ride-hailing app and would like to keep track of the top products or destinations within an hour or a period of time. How would we do it?\n
Code Musings