-
Notifications
You must be signed in to change notification settings - Fork 247
Adding priority queue implementation #1542
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
Comments
Hi @damhiya, thanks for opening the issue, yes we'd definitely be interested in a priority queue implementation! However, the first thing we'd want to do I think is to define an interface (operations + laws) for priority queues. We'd then show that your implementation satisfied that interface. Would you be interested/willing to put together such an interface? |
Of course! |
Great! If you'd like to open a PR with your proposed interface (probably in |
See feedback in #1552 for a design discussion. |
I'm really sorry for inactivity. I was doing other works. I'll work on this in the future unless someone do it. |
Absolutely no worries, not everything has to be added. Our discussion alone has really helped clarify my thoughts on this, so thanks! |
Btw, I played around with a leftist heap implementation in Agda and ended up with this: https://gist.github.com/andreasabel/352fee52a39c0bebbd5059bff86d9b6e |
We do have a generic min construction: http://agda.github.io/agda-stdlib/Algebra.Construct.NaturalChoice.Min.html |
Here's a different implementation I made a while back, using pairing heaps: https://gist.github.com/Taneb/7e502c708e2e6eabcea5e7638f42b593 |
Hi.
I implemented leftist heap based priority queue in agda.
So I'm going to contribute this code to agda-stdlib if such thing was desired.
However, this code is a bit messy and I didn't care so much about library design while writing it.
I would appreciate if someone give a comment about the code.
The text was updated successfully, but these errors were encountered: