Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ralgond/topk
A data structure for finding the top k elements
https://github.com/ralgond/topk
go topk
Last synced: 5 days ago
JSON representation
A data structure for finding the top k elements
- Host: GitHub
- URL: https://github.com/ralgond/topk
- Owner: ralgond
- License: mit
- Created: 2023-09-14T01:47:26.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2023-09-15T02:42:26.000Z (about 1 year ago)
- Last Synced: 2023-09-19T09:10:00.817Z (about 1 year ago)
- Topics: go, topk
- Language: Go
- Homepage:
- Size: 9.77 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# topk
A data structure for finding the top k elements## how to use
```go
package mainimport (
"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())
}
```