The best way to search a standard PQ is always going to be O

. If you back it with something like a red-black tree to maintain order, you can get O

search time, but there is a severe penalty:
to dequeue from the PQ now takes O(log n) (not O(1)) because you have to patch the red-black tree. So, long story short, you can't have your cake and eat it to.
If you really find that you need to occasionally search the thing, use a binary heap for the PQ, then you can scan the array for the heap with little cost. Plus, if you aren't dequeue-ing, just searching this way, your pop operation on the PQ is still O(1).