"deleteElement" operation is buggy
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.
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.
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.
@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.
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!
No problem!