func newTopK(k, d, w int) *topK {
	t := topK{
		x:   make([][]uint64, d),
		top: make(topHeap, k),
		h:   make([]uint64, d),
		w:   w,
		d:   d,
	}
	for i := range t.x {
		t.x[i] = make([]uint64, w)
	}
	return &t
}
k is the number of top entries to track.
w is the width of each array, typically small (4-8).
d is the number of hash functions, typically medium (1024-16384).
consult your favorite count min sketch exposition
to learn how to interpret and pick these.
package main
import (
	"container/heap"
	"math"
	"sort"
	"github.com/spaolacci/murmur3"
)
type stringCount struct {
	s string  
	n uint64  
}
type stringsByCount []stringCount
func (l stringsByCount) Len() int { return len(l) }
func (l stringsByCount) Less(i, j int) bool {
	x, y := l[i], l[j]
	if x.n != y.n {
		return x.n > y.n  
	}
	return x.s < y.s
}
func (l stringsByCount) Swap(i, j int) { l[i], l[j] = l[j], l[i] }
type topK struct {
	x    [][]uint64  
	w, d int         
	top  topHeap     
	h    []uint64    
}
type topHeap []stringCount
func (h topHeap) Len() int            { return len(h) }
func (h topHeap) Less(i, j int) bool  { return h[i].n < h[j].n }
func (h topHeap) Swap(i, j int)       { h[i], h[j] = h[j], h[i] }
func (h *topHeap) Push(x interface{}) { *h = append(*h, x.(stringCount)) }
func (h *topHeap) Pop() interface{} {
	x := (*h)[len(*h)-1]
	*h = (*h)[:len(*h)-1]
	return x
}