| 123456789101112131415161718192021222324252627282930313233343536 |
- type 'a arbre = Vide | Noeud of 'a * 'a arbre * 'a arbre;;
- let rec max_arbre arbre1 = match arbre1 with
- | Vide -> 0
- | Noeud(r,g,d)-> max (max r (max_arbre g)) (max_arbre d)
- ;;
- type 'a infini = Infplus| Infmoins | Valeur of 'a ;;
- (* let inferieurstrict x y = match scrutinee with
- | pattern -> pattern *)
- type abr = Vide | Noeud of int * abr * abr;;
- let rec test_abr a = match a with
- | Vide -> true
- | Noeud(r,g,d)-> ((r>=max_arbre g)&&(r<min_arbre)&&(test_abr g)&&(test_abr d))
- ;;
|