PQueue now maintains a map of the number of each element it contains to make contains happen in constant time.