⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 huffmannode.java

📁 java版的数据结构的完全代码 免费提供了 学习数据结构的请下载
💻 JAVA
字号:
// Introduced in Chapter 17/** Node in a Huffman tree. */public class HuffmanNode extends BinaryNode<Character>  implements Comparable<HuffmanNode> {  /** Frequency of this letter or set of letters. */  private int count;  /** Create a node with no children. */  public HuffmanNode(char letter, int count) {    super(letter);    this.count = count;  }  /**   * Create a node with two children.  Its count is the sum of   * its children's counts.   */  public HuffmanNode(HuffmanNode left, HuffmanNode right) {    super('?', left, right);    this.count = left.count + right.count;  }  /** The comparison is based on the counts of the nodes. */  public int compareTo(HuffmanNode that) {    return count - that.count;  }}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -