type 'a avl = Empty | Node of int * 'a avl * 'a * 'a avl


let altura = function
  Empty -> 0
| Node(h, _, _, _) -> h

let rec folhas = function 
  Empty -> 0
| Node (_, Empty, _, Empty) -> 1
| Node (_, e,_,d) -> folhas e + folhas d 
 
let rec nodos = function 
  Empty -> 0
| Node (_, e,_,d) -> 1 + nodos e + nodos d

This document was generated using caml2html