Alright, I was wondering what would be the best way to do the following:

I'm trying to maintain a collection of objects, and I want to be able to quickly search on two different parameters. Quick addition and deletion is also necessary. Essentially, items have a unique string ID and a (not necessarily unique) cost associated with each. I want to be able to add/remove items by string, and also I want to be able to remove the highest-cost item, without looking at each item's cost one at a time. If multiple items tie for the highest cost, I don't care which I get.

I was thinking doing two self-balancing trees (like 2 red-black trees) where each node in the first tree had a counterpart in the other. The benefit is that I can do all operations in log time, but it's going to be a little more complicated to handle the trees themselves; I have to cause the nodes to be linked, and I have to make sure a deletion in one tree causes a deletion in the other.

Is there a simpler/more elegant way? As I can make this work in log time, any alternate would have to be at least as fast.