更新实验报告

This commit is contained in:
Luthics 2023-12-19 03:23:35 +08:00
parent da0755858e
commit 7123a79aa6
3 changed files with 3505 additions and 4 deletions

11
1/dp.in
View File

@ -1,4 +1,7 @@
70 3 10 6
71 100 1 1
69 1 8 4
1 2 4 2
3 2
5 3
2 2

14
7/s3.c
View File

@ -259,6 +259,18 @@ void pt(Tree *root) {
printf("\n"); printf("\n");
} }
// 打印二叉树
void printTree(Tree *root, int level) {
if (root == NULL)
return;
printTree(root->r, level + 1);
for (int i = 0; i < level; i++)
printf(" ");
printf("%d\n", root->val);
printTree(root->l, level + 1);
}
int main() { int main() {
freopen("data.in", "r", stdin); freopen("data.in", "r", stdin);
scanf("%d", &n); scanf("%d", &n);
@ -276,6 +288,8 @@ int main() {
scanf("%d", &x); scanf("%d", &x);
root = deleteNode(root, x); root = deleteNode(root, x);
pt(root); pt(root);
printTree(root, 0);
printf("----------------\n");
} }
return 0; return 0;

3484
report.md Normal file

File diff suppressed because it is too large Load Diff