コード例 #1
0
 @Override
 public int compareTo(HuffmanNode hn) {
   if (frequency > hn.getFrequency()) {
     return 1;
   } else {
     return -1;
   }
 }
コード例 #2
0
  @Override
  public HuffmanNode merge(HuffmanNode right) {
    HuffmanNode parent = new HuffmanNeuron(frequency + right.getFrequency(), vector.length);

    parentNeuron = parent;
    this.code = 0;
    right.setParent(parent);
    right.setCode(1);
    return parent;
  }