An implementation of generic PriorityQueue that changes behavior during runtime and be either a Max or a Min Priority Queue.