I have a java assignment involving iterating a priority queue. The queue consists of objects with a string and an int in them and i need to have a way to check a seperate object's string against all the objects in the queue.
Would it be best way to do this be an iterator object? That seems too messy. I could dequeue and enqueue but that seems inefficient. Maybe a foreach loop?