MCPcopy Create free account
hub / github.com/Ayush7614/Daily-Coding-DS-ALGO-Practice / compare

Method compare

Gfg/Java/Huffman Encoding.java:27–33  ·  view source on GitHub ↗
(Node n1,Node n2)

Source from the content-addressed store, hash-verified

25 PriorityQueue<Node> queue=new PriorityQueue<>(new Comparator<Node>()
26 {
27 @Override
28 public int compare(Node n1,Node n2)
29 {
30 if(n1.freq==n2.freq)
31 return 1;
32 return n1.freq-n2.freq;
33 }
34 }
35 );
36 for(int i=0;i<str.length();i++)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected