## Priority Queue Using Heap

Hello ,
i am working on a question and the task i need to do is implement a priority queue using min heap and max heap . i was able to get my max heap to work and thought changing the signs would do the opposite (min heap ) but it does not seem to work . Any inputs ?
The percolate up and down is a lil jumbled , but for insert i use percolate up , thinking percolate down will do the opposite , it would still do the same .
The code snippet :
Code:
```template <class T>void MinHeapTest<T>::PercolateDown(int head,int tail)
{
int maxChild;
int right;
int left;
MinHeap<T> temp;

left = head * 2 + 1;
right = head * 2 + 2;

if(left <= tail)
{
if(left == tail)
{
maxChild = left;
}
else
{
if(i1[left].getpriority() <= i1[right].getpriority())
maxChild = right; //right
else
maxChild = left; //left
}
{

i1[maxChild] = temp;
PercolateDown(maxChild,tail);//tail
}
}

}
template <class T>
{

int temp1;
MinHeap<T> temp2;

{
temp1 = (tail -1) / 2;
if(i1[temp1].getpriority() < i1[tail].getpriority())
{

temp2 = i1[temp1];
i1[temp1] =i1[tail];
i1[tail] = temp2;