public void insert(Pnode node){
        count++;
        if(pq==null){
            pq=node;
        }
        else if(pq.freq>node.freq){
            node.next=pq;
            pq=node;
        }
        else{
            Pnode temp = pq;
            Pnode prev = null;
            while(temp.next!=null && temp.freq<=node.freq){
                prev=temp;
                temp=temp.next;
            }
            if(temp.freq>node.freq){
                prev.next=node;
                node.next=temp;
            }
            else{
             temp.next=node;
            }

        }
    }