minmaxheap-cpp icon indicating copy to clipboard operation
minmaxheap-cpp copied to clipboard

"deleteElement" operation is buggy

Open nbro opened this issue 9 years ago • 5 comments

Check my first and only comment of a gist here https://gist.github.com/gnarmis/4647645, where the original author implemented (in Python) a DeleteAt operation which works similar to yours, for an explanation.

nbro avatar Sep 07 '16 18:09 nbro

Oh wow! Interesting. This is some code I wrote back in high school and I probably won't take the time to fix this bug, but thank you!

If you create a test case that works with this code and submit a PR I promise to at least make an attempt at fixing it.

itsjohncs avatar Sep 09 '16 21:09 itsjohncs

I added a note in the README to check out the issue tracker though that will hopefully dissuade people from using it in their production code before evaluating it properly.

itsjohncs avatar Sep 09 '16 21:09 itsjohncs

@brownhead I've a correct implementation of the "delete-at" method in my implementation of the min-max heap, but it's in Python. I could fix also your code, since I can use also C++, but currently I don't have time, so I will just point you to my Github's repository containing my implementation, and if you want, you can fix it, it should require you just a few minutes anyway.

Also, I would be very glad if you could support the project I'm linking you to:

https://github.com/nbro/ands/blob/master/ands/ds/MinMaxHeap.py

Note that's not the master branch and I may at some point merge this branch with the master one.

nbro avatar Sep 09 '16 21:09 nbro

I almost certainly won't get to it either, but that's a good resource for anyone who comes across this project and wants to bring it into their own project. Thank you!

itsjohncs avatar Sep 09 '16 21:09 itsjohncs

No problem!

nbro avatar Sep 09 '16 21:09 nbro