1.哈弗曼树的节点声明

 1 package com.neusoft.Tree;
 2 
 3 public class HuffmanNode {
 4     public int weight;
 5     //加入哈夫曼树的标志,flag=0表示该节点没有加入哈夫曼树,=1表示加入
 6     public int flag;
 7     public HuffmanNode parent,lchild,rchild;
 8     public HuffmanNode() {
 9         this(0);
10     }
11     public HuffmanNode(int weight){
12         this.weight=weight;
13         flag=0;
14         parent=lchild=rchild=null;
15     }
16 }

点击可复制代码

 1 package com.neusoft.Tree;
 2 
 3 public class HuffmanNode {
 4     public int weight;
 5     //加入哈夫曼树的标志,flag=0表示该节点没有加入哈夫曼树,=1表示加入
 6     public int flag;
 7     public HuffmanNode parent,lchild,rchild;
 8     public HuffmanNode() {
 9         this(0);
10     }
11     public HuffmanNode(int weight){
12         this.weight=weight;
13         flag=0;
14         parent=lchild=rchild=null;
15     }
16 }
点击+可复制代码

相关文章:

  • 2021-12-11
  • 2021-05-30
  • 2021-09-02
  • 2021-11-24
  • 2021-09-23
  • 2021-11-14
  • 2022-12-23
  • 2021-05-11
猜你喜欢
  • 2021-09-20
  • 2021-06-02
  • 2021-05-27
  • 2021-12-18
  • 2021-11-13
  • 2021-05-09
  • 2021-09-14
相关资源
相似解决方案