Skip to content

Commit df42e09

Browse files
committed
第四章 Part2
1 parent ffcdf3d commit df42e09

10 files changed

+9
-0
lines changed

4-5-10.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -71,4 +71,5 @@ void Print_BST(BST T,int tag){
7171
if(tag==2)cout<<T->key<<" ";
7272
Print_BST(T->rchild,tag);
7373
if(tag==3)cout<<T->key<<" ";
74+
free(T);
7475
}

4-5-11.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -120,4 +120,5 @@ void Print_HTree(HTree T,int tag){
120120
if(tag==2)cout<<T->data<<" ";
121121
Print_HTree(T->rchild,tag);
122122
if(tag==3)cout<<T->data<<" ";
123+
free(T);
123124
}

4-5-12-ans.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -89,4 +89,5 @@ void Print_BST(BST T,int tag){
8989
if(tag==2)cout<<T->key<<":"<<T->count<<" ";
9090
Print_BST(T->rchild,tag);
9191
if(tag==3)cout<<T->key<<":"<<T->count<<" ";
92+
free(T);
9293
}

4-5-12.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -76,4 +76,5 @@ void Print_BST(BST T,int tag){
7676
if(tag==2)cout<<T->key<<" ";
7777
Print_BST(T->rchild,tag);
7878
if(tag==3)cout<<T->key<<" ";
79+
free(T);
7980
}

4-5-7.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -78,4 +78,5 @@ void Print_BST(BST T,int tag){
7878
if(tag==2)cout<<T->key<<" ";
7979
Print_BST(T->rchild,tag);
8080
if(tag==3)cout<<T->key<<" ";
81+
free(T);
8182
}

4-5-8.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -74,4 +74,5 @@ void Print_BST(BST T,int tag){
7474
if(tag==2)cout<<T->key<<" ";
7575
Print_BST(T->rchild,tag);
7676
if(tag==3)cout<<T->key<<" ";
77+
free(T);
7778
}

4-5-9.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -72,4 +72,5 @@ void Print_BST(BST T,int tag){
7272
if(tag==2)cout<<T->key<<" ";
7373
Print_BST(T->rchild,tag);
7474
if(tag==3)cout<<T->key<<" ";
75+
free(T);
7576
}

4-BST.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -65,4 +65,5 @@ void Print_BST(BST T,int tag){
6565
if(tag==2)cout<<T->key<<" ";
6666
Print_BST(T->rchild,tag);
6767
if(tag==3)cout<<T->key<<" ";
68+
free(T);
6869
}

4-HuffmanTree

0 Bytes
Binary file not shown.

4-HuffmanTree.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -114,4 +114,5 @@ void Print_HTree(HTree T,int tag){
114114
if(tag==2)cout<<T->data<<" ";
115115
Print_HTree(T->rchild,tag);
116116
if(tag==3)cout<<T->data<<" ";
117+
free(T);
117118
}

0 commit comments

Comments
 (0)