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
   |  
void noeud::init_arbre (noeud *const arbre, double x_0, double a, double b)
{
	noeud *pt_dash;
 
	pt_dash=arbre;
	double su,sd;
 
	if (pt_dash->fils_haut!= NULL )
	{
		arbre->valeurs = &x_0;
				if ( pt_dash->fils_haut->valeurs == NULL)
					{
						su=*pt_dash->fils_haut->pere_bas->valeurs*a;
						double Tab[4]={su,0,0,0};
						pt_dash->fils_haut->set_valeurs(Tab,4);
					}
				if ( pt_dash->fils_bas->valeurs == NULL)
					{
						sd=*pt_dash->fils_bas->pere_haut->valeurs*b;
						double Tab[4]={sd,0,0,0};
						pt_dash->fils_bas->set_valeurs(Tab,4);
					}
				pt_dash->init_arbre(pt_dash->fils_haut,su,a,b);
				pt_dash->init_arbre(pt_dash->fils_bas,sd,a,b);
 
 
	}
} | 
Partager