Abr

Fermé
Bonjour,
ceux qui pourrons faire un programme principale pour testé cette fonction(arbre binaire de recherche):

struct Noeud
{
int valeur;
struct Noeud *gauche;
struct Noeud *droite;
};
struct Noeud *arbre;

struct Noeud *recherche(struct Noeud *racine,int x)
{
if(racine->valeur==x) return racine;
if(x <= racine->valeur)
{
if(racine->gauche != NULL)
return recherche(racine->gauche,x);
else return NULL;
}
else
{if(racine->droite != NULL)
return recherche(racine->droite,x);
else
return NULL;
}
}
Configuration: Windows XP
Opera 9.23

1 réponse