func New(n int) *Stream {
	return &Stream{
		n:      n,
		k:      keys{m: make(map[string]int), elts: make([]Element, 0, n)},
		alphas: make([]int, n*6),  
	}
}
New returns a Stream estimating the top n most frequent elements
package topk
import (
	"bytes"
	"container/heap"
	"encoding/gob"
	"sort"
	"github.com/dgryski/go-sip13"
)
type Element struct {
	Key   string
	Count int
	Error int
}
type elementsByCountDescending []Element
func (elts elementsByCountDescending) Len() int { return len(elts) }
func (elts elementsByCountDescending) Less(i, j int) bool {
	return (elts[i].Count > elts[j].Count) || (elts[i].Count == elts[j].Count && elts[i].Key < elts[j].Key)
}
func (elts elementsByCountDescending) Swap(i, j int) { elts[i], elts[j] = elts[j], elts[i] }
type keys struct {
	m    map[string]int
	elts []Element
}
func (tk *keys) Len() int { return len(tk.elts) }
func (tk *keys) Less(i, j int) bool {
	return (tk.elts[i].Count < tk.elts[j].Count) || (tk.elts[i].Count == tk.elts[j].Count && tk.elts[i].Error > tk.elts[j].Error)
}
func (tk *keys) Swap(i, j int) {
	tk.elts[i], tk.elts[j] = tk.elts[j], tk.elts[i]
	tk.m[tk.elts[i].Key] = i
	tk.m[tk.elts[j].Key] = j
}
func (tk *keys) Push(x interface{}) {
	e := x.(Element)
	tk.m[e.Key] = len(tk.elts)
	tk.elts = append(tk.elts, e)
}
func (tk *keys) Pop() interface{} {
	var e Element
	e, tk.elts = tk.elts[len(tk.elts)-1], tk.elts[:len(tk.elts)-1]
	delete(tk.m, e.Key)
	return e
}
type Stream struct {
	n      int
	k      keys
	alphas []int
}