[OPT TP3] J'ai oublié de commit l'avant dernière question :c

This commit is contained in:
Suwako Moriya 2020-10-10 17:01:13 +02:00
parent 89b4ced546
commit 6ceadece68

View File

@ -62,6 +62,11 @@ reconstruit test;;
let rebalance t = match t with
|Vide -> Vide
|Noeud(i,_,fg,fd) -> let n = float_of_int i in if ((taille fg) < alpha*.n ) && ((taille fd) < alpha*.n) then t else reconstruit t;;
float_of_int;;
alpha* float_of_int.5;;
|Noeud(i,_,fg,fd) -> let n = float_of_int i in if (float_of_int (taille fg) < alpha*.n ) && (float_of_int (taille fd) < alpha*.n) then t else reconstruit t;;
rebalance test;;
let rec insere_be a t = match t with
|Vide -> creer_noeud a Vide Vide
|_ -> let Noeud(i,e,fg,fd) = rebalance t in if a <= e then creer_noeud e (insere_be a fg) fd else creer_noeud e fg (insere_be a fd);;
insere_be 3 test;;