Home > Back-end >  C language to read the file after operation affect the structure variable data
C language to read the file after operation affect the structure variable data

Time:03-04

At the time of practice data structure problems recently
 
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:

reference 1st floor ctrigger response:
Huffman coding, YanWeiMin teacher speaks very clearly on the data structure of,

I know this is, I just want to ask why read the file before and after the change happens twice the value of the tree

CodePudding user response:

refer to the second floor Ice 丨 shine response:
Quote: refer to 1st floor ctrigger response:
Huffman coding, YanWeiMin teacher speaks very clearly on the data structure of,

I know this is, I just want to ask why read the file before and after the two tree change value of


Algorithm you already know, do you have any questions, that is the C language, see K& R C,
  • Related