Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Heap interface (for priority queues) #110

Open
aseemk opened this issue Dec 26, 2017 · 0 comments
Open

Heap interface (for priority queues) #110

aseemk opened this issue Dec 26, 2017 · 0 comments

Comments

@aseemk
Copy link

aseemk commented Dec 26, 2017

Hey there,

Great work again. =) Just wanted to say it'd be sweet if the slice typewriter could support codegen'ing a PriorityQueue implementation too, via the Heap interface:

https://golang.org/pkg/container/heap/ (see PriorityQueue example)

Although if it's helpful, what I'm really looking to do is something like a "top N by <func>". An ideal implementation would use a heap/priority queue with capacity N, so discard anything ranked lower than N as I iterate over the slice and add things to this heap/priority queue.

Thanks for the consideration!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant