Exemplo n.º 1
0
int main()
{
 int tablo[10], *pt;
 srand(time(NULL));
 pt=tablo;
 printf("taille tablo = %d\ntaille pt = %d\n", sizeof(tablo), sizeof(pt));
 remplir(tablo,10);
 afficher(tablo, 10);
 remplir2(tablo,10);
 afficher2(tablo, 10);
 remplir(pt,10);
 afficher(pt, 10);
 remplir2(pt,10);
 afficher2(pt, 10);
 return 0;
}
Exemplo n.º 2
0
//OK
// De même que l'affichage.
void afficher2(Arbre* racine)
{
	if(racine!=NULL)
	{
        //On est sur le premier noeud {
		printf("{");
        //On affiche tous les sous arbres gauches
		afficher2(racine->gauche);
        //On affiche la racine
		printf(",%d,",racine->valeur);
        //On affiche tous les sous abres droits
		afficher2(racine->droit);
		//On a finit l'affichage du noeud }
        printf("}");
	}
	else
    {
        //Dans le cas ou nous n'avons pas de sous arbre gauche ou droit on affiche '_'
		printf("_");
    }
}