[OPT TP3] J'ai oublié de commit l'avant dernière question :c
This commit is contained in:
parent
89b4ced546
commit
6ceadece68
@ -62,6 +62,11 @@ reconstruit test;;
|
|||||||
|
|
||||||
let rebalance t = match t with
|
let rebalance t = match t with
|
||||||
|Vide -> Vide
|
|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;;
|
|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;;
|
||||||
float_of_int;;
|
rebalance test;;
|
||||||
alpha* float_of_int.5;;
|
|
||||||
|
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;;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user