laurent57150
Messages postés14Date d'inscriptionjeudi 25 mai 2006StatutMembreDernière intervention30 avril 2007
-
31 mai 2006 à 18:09
laurent57150
Messages postés14Date d'inscriptionjeudi 25 mai 2006StatutMembreDernière intervention30 avril 2007
-
31 mai 2006 à 19:37
Bonjour j'essaye d'ecrire un programme utilisant un arbre binaire!
Le probleme c'est que pour remplir mon arbre j'utilise une fonction recursive mais a chaque fois l'adresse de mon pointer passe à 0!
Et donc mon arbre est vide à la fin :(
void ajoutmot(char * mot,arbre * root,int depart,int * l)
{
arbre * temparbre;
printf("%x\n",root);
//while we are not at the end of the world
if( * l>depart)
{
//if we are a the root of the tree
if(root == NULL)
{
//root is NULL so we can addthe letter here
//first we allow memory for the node
//next letter for the next round
depart++;
//root because the arbre that we have jsut created by putting the pointer of temparbre in root
root = temparbre;
ajoutmot(mot,(* root).fils,depart,l);