Generic priority queue with double value priority implemented with heap