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

Binary Heap that allows for interior mutability #41

Open
Wasabi375 opened this issue Mar 16, 2023 · 1 comment
Open

Binary Heap that allows for interior mutability #41

Wasabi375 opened this issue Mar 16, 2023 · 1 comment

Comments

@Wasabi375
Copy link

This isn't really an issue with this repo so feel free to close this if you want.

I'm currently in the need for a binary heap that allows mutating the values stored within and then updating the heap accordingly.
Since I couldn't find any implementation I started creating my own based on this repository.

Instead of just storing values I store key-value pairs. This allows me to implement get, get_mut, contains_key, etc. You can think of it as a mix between your implementation and HashMap (which I use internally).

My implementation can be found here: https://github.com/Wasabi375/mut-binary-heap

Why did I not just create a PR for this repo?

The changes I wanted to make require quite a large overhall of the API to support key-value pairs. I feel like there is both a usecase for your simpler implementation and mine and therefor a PR is not enough.

Why do I post here?

This is mostly a friendly heads up that I created this fork. If anyone here finds this and wants to look over my changes, feel free to do so. Any feedback is welcome.

Current Status

The main implementation is working. However I still need to change all tests to the new API and provide usefull traits like Into, From, etc. Also I have not yet published my fork to crates.io. I will do so, once I have the tests ready and also post an update here (unless you close this issue first).

Any changes that I want to see in this repo?

Not really. Of cause I would love a shoutout in the readme once I publish my crate, but that is obviously up to you. Other than that I will of port any bugfixes (if I find any bugs) or at least create an issue here.

Thanks for this greate repo.

It was a nice starting point, even if it is mostly an extension to the standard library implementation.

@Wasabi375
Copy link
Author

I just published v0.1.0 of the mut-binary-heap crate: https://crates.io/crates/mut-binary-heap
There is still some work to do, but I fell compfortable to publish the crate in the current state.
This will also most likely be my last update post here, as not to spam this repository.

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