Skip to content
/ topk Public

A data structure for finding the top k elements

License

Notifications You must be signed in to change notification settings

ralgond/topk

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

topk

A data structure for finding the top k elements

how to use

package main

import (
	"fmt"
	"github.com/ralgond/topk"
)

func main() {
	_topk := topk.NewTOPK(3)

	_topk.Add2(3, 3)
	_topk.Add2(4, 4)
	_topk.Add2(6, 6)
	_topk.Add2(1, 1)
	_topk.Add2(2, 2)
	_topk.Add2(5, 5)

	fmt.Println(_topk.Dumps())
}

About

A data structure for finding the top k elements

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages