Untitled

mail@pastecode.io avatar
unknown
ocaml
2 years ago
260 B
0
Indexable
Never
exception MissingKey;;

let rec delete = function
    Lf, _ -> raise MissingKey
  | Br ((k, v), t1, t2), del_k ->
      if del_k < k then Br ((k, v), delete (t1, del_k), t2)
      else if del_k > k then Br((k, v), t1, delete (t2, del_k))
      else Lf;;