I often find it convenient to work with maps and started with one, but I think it was an unnecessary and potentially confusing choice here. I have instead changed the keys container to be an instance of class vector<key_type>. That way you can treat the values and keys containers similarly, and the index for a particular element's value is then the same as the element's key in the BinaryHeap.
Comment here if you have any questions or concerns!
https://github.com/prof-erik/cisc4080/blob/568984a1b3e587f0650c5a7a78bd524f6deca8d0/bin_heap.h#L16-L17
I often find it convenient to work with maps and started with one, but I think it was an unnecessary and potentially confusing choice here. I have instead changed the
keys
container to be an instance of classvector<key_type>
. That way you can treat thevalues
andkeys
containers similarly, and the index for a particular element's value is then the same as the element's key in the BinaryHeap.Comment here if you have any questions or concerns!