what is wrong with this PriorityQueue?
<pre><code>fringe = new PriorityQueue&lt;Node&gt;(10,new Comparator&lt;Node&gt;(){
            @Override
            public int compare(Node node1,Node node2)
            {
                if (f(node1)&gt;f(node2))
                    return 1;
                else
                    return -1;
            }
        });
</code></pre>

<p>I declared a PQ to store some nodes and i want to store the nodes in non-decreasing order according to the f value.function f(Node node) is to calculate the f value for the node. so i override the comparator but right now i found that some nodes with larger f value are placed before the ones with smaller f value in the queue, i checked all over but still cannot find what goes wrong, i assume maybe it is the PQ declaration's problem. Anyone can help me? Thanks in advance!</p>
