I'm currently trying to figure out which data structure might be the best one to use. So here is what I am trying to do:
I have an object and a value associated with this object. I want to be able to know which entry in the structure has the smallest value.
So for example if I have the following objects:
ZebraObject, 10
CowObject, 1
DogObject, 2
I want to be able to know which object has the smallest value (which in this case, is CowObject). I'll also have to access the data inside the CowObject (call some functions, do some calculation etc) and at the end, I'll be doing something like 'value += value'. So after I've accessed the CowObject, the data will look like
ZebraObject, 10
CowObject, 2 // (1 + 1)
DogObject, 2
Can anyone help me figure out what the best data structure for this situation?
Edit: I'm assuming that every elements (at least for the object), are unique. The float value associated with the object can be duplicates.