# include # include using namespace std; /***************definition du types Arbre ****************************/ struct Noued{ int ele; Noued *FG,*FD; }; typedef Noued *arbre; /***************declaration des fonctions ****************************/ arbre creer_noeud (int x); int contenu (arbre a); arbre filsG (arbre a) ; arbre filsD (arbre a) ; bool est_vide(arbre a) ; void afficher (arbre a); int somme (arbre a); // retourne la somme des éléments de l'arbree a arbre cons (int x, arbre Fg, arbre Fd); void creer (arbre &a); /***************Le programme principale****************************/ int main() { arbre a; creer (a); } /***************definition des fonctions ****************************/ arbre creer_noeud (int x) { arbre N=new Noued(); N->ele =x; N->FG=NULL; N->FD=NULL; return N; } arbre cons (int x, arbre Fg, arbre Fd) { arbre a = creer_noeud(x); a->FG = Fg; a->FD = Fd; return a; } void creer (arbre &a) { arbre a1=cons(19, (cons (7, NULL, NULL)), (cons (20, NULL, NULL) )); arbre a2= cons(30, (cons (15, NULL, NULL)), (cons (90, NULL, NULL))); a=cons (100, a1, a2); }