-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.c
67 lines (54 loc) · 1.25 KB
/
main.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
#include "arbre.c"
#include <stdio.h>
#include <stdlib.h>
int main()
{
struct noeud * abr = creer_arbre();
ajouter(&abr,100);
ajouter(&abr,170);
ajouter(&abr,150);
/**
ajouter(&abr,20);
ajouter(&abr,10);
ajouter(&abr,170);
ajouter(&abr,120);
*/
affiche(abr);
if(predecessor(abr))
printf("\npredecessor of %d is %d\n",abr->cle,predecessor(abr));
if(successor(abr))
printf("\nsuccessor of %d is %d\n",abr->cle,successor(abr));
/*
ajouter(&abr,3);
ajouter(&abr,6);
ajouter(&abr,4);
ajouter(&abr,7);
ajouter(&abr,5);
ajouter(&abr,1);
ajouter(&abr,2);
ajouter(&abr,0);
*/
/*
ajouter(&abr,150);
ajouter(&abr,50);
ajouter(&abr,20);
ajouter(&abr,70);
ajouter(&abr,120);
ajouter(&abr,170);
*/
/*
affiche(abr);
printf("\nmax= %d\n",recherche_max(abr)->cle);
printf("\nmin= %d\n",recherche_min(abr)->cle);
*/
/* supprimer_element(&abr,5);
supprimer_element(&abr,4);
supprimer_element(&abr,3);
affiche(abr); */
/* ajouter(&abr,5);
printf("\n%d\n",abr->cle);
printf("\ngauche %d\n",abr->sag->cle);
printf("\ndroite %d\n",abr->sad->cle);
printf("\nEXISTE %d \t : %d\n",abr->sag->cle,recherche(abr,abr->sag->cle));
*/
return 0;}