# Count-Min Sketch

+ CM sketch counts the number of each element using arrays and hash functions.
+ Multiple hash functions and arrays are used to mitigate the collisions


![`smart`](CountMinSketch01_aa_001_20230915.png)

----------------------------------------------------
The fundamental concept of the `Count-Min Sketch` structure involves creating an array of length x for counting purposes, where each element initially has a count value of 0. When a new element arrives, it is hashed to generate a number between 0 and x. For instance, if the hash yields a value i, this value serves as the index position within the array. Consequently, the count at index i in the array is incremented by 1. Each time the element appears in the table column, the count at the corresponding index i is again increased by 1, thereby maintaining an ongoing tally of occurrences.