The Display (tree);
If ((write=fopen (" TextFile. TXT ", "w"))==NULL) {
Printf (" file read failure \ n ");
return 0;
}
The Display (tree);
The Display is a function of print tree, specific code is as follows:
Void the Display (HuffmanTree tree) {
int i;
Printf (subscript character weights "left child right child parents \ n");
for(i=1; i<=tree - & gt; Htsize; I++) {
printf("%d",i);
Printf (" % 9 c, "the tree - & gt; Ht [I]. Ch);
Printf (" % 9 d, "the tree - & gt; Ht [I]. Weight);
Printf (" % 9 d, "the tree - & gt; Ht [I] lchild);
Printf (" % 9 d, "the tree - & gt; Ht [I] rchild);
Printf (" % 9 d \ n ", the tree - & gt; Ht [I]. Parent);
Printf (" _______________________________________________ \ n ");
}
}
Two printing effect
Why is this so? consult
CodePudding user response:
Huffman coding, YanWeiMin teacher speaks very clearly on the data structure of,CodePudding user response: