Class CountMinSketch


  • public class CountMinSketch
    extends Object
    A count-min sketch implementation.
    • Constructor Detail

      • CountMinSketch

        public CountMinSketch​(int k,
                              int m)
        Create a new instance.
        Parameters:
        k - the number of hash functions
        m - the number of buckets per hash function (must be a power of 2)
    • Method Detail

      • addAndEstimate

        public long addAndEstimate​(long hash)
        Add an entry.
        Parameters:
        hash - the hash
        Returns:
        the new estimation
      • add

        public void add​(long hash)
      • estimate

        public long estimate​(long hash)