1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
//! Estimating per-item frequencies in a stream with a Count-Min Sketch.
//!
//! A Count-Min Sketch answers "how often have I seen this?" in fixed memory,
//! trading a small, one-sided overcount for not storing a counter per key. This
//! example feeds a skewed stream (a few hot keys, a long tail) and compares the
//! estimates against the exact counts.
//!
//! Run it with:
//!
//! ```text
//! cargo run --example frequency --release
//! ```
use CountMinSketch;