Neural Sync Active
Count Sketch
Registry Synced
Count Sketch
92 words
1 min read
Reading compass
Now · Algorithm
Count Sketch
Algorithm
Maintain a t×k array C of counters and t hash functions hj mapping items to [k], plus t sign hash functions gj mapping items to {−1,+1}.
Update: For item i, C[j][hj(i)]+=gj(i) for j=1,…,t.
Query: f^i=medianjC[j][hj(i)]⋅gj(i)
Heavy Hitters
Find items with frequency >ϕn (where n is stream length).
Misra-Gries: O(k) space, guarantees ϕ=1/(k+1).
Count-Min + Heap: Track top items in a min-heap alongside sketch.
Join Discord
PreviousRandomized OptimizationNextSublinear Algorithms