-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTPz.c
80 lines (64 loc) · 1.46 KB
/
TPz.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
#include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>
#include <Windows.h>
#include"./verification.h"
int main()
{
tree tab[100];
tree* root=NULL;
// root=create_tree(root);
// print_tree(root,0);
// root=insert(root,45);
// root=insert(root,20);
// root=insert(root,10);
// root=insert(root,35);
// root=insert(root,65);
// root=insert(root,55);
// root=insert(root,50);
// root=insert(root,58);
// root=insert(root,56);
// root=insert(root,57);
// root=insert(root,60);
// root=insert(root,62);
// root=insert(root,85);
// root=insert(root,75);
// root=insert(root,95);
// root=insert(root,90);
// root=insert(root,88);
// root=insert(root,98);
//
root=insert(root,328);
root=insert(root,287);
root=insert(root,302);
root=insert(root,956);
root=insert(root,407);
root=insert(root,574);
root=insert(root,704);
root=insert(root,884);
root=insert(root,969);
root=insert(root,960);
print_tree(root,0);
branche_trav_L(root);
reset_visited(root);
printf("\n\n\n\n\n\n\n");
// branche_trav_R(root);
// reset_visited(root);
// printf("\n\n\n\n\n\n\n");
// leaf_trav_L(root);
// reset_visited(root);
// printf("\n\n\n\n\n\n\n");
// leaf_trav_R(root);
// free_tree(root);
preorder(root);
printf("\n\n");
int ind=0;
branch_verpre(root,tab,&ind);
for (int i = 0; i < 10; i++)
{
printf("%d |", tab[i].val);
}
printf("\n\n\n\n\n\n");
branch_trav(tab,10);
return 0;
}