Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- type arbre = Noeud of bool ref * (char * arbre) list ref
- (*Not necessary but left here in case *)
- let rec creer_branche cs = match cs with
- | [] -> vide ()
- | [c] -> Noeud (ref false, ref [c, Noeud(ref true, ref [])])
- | c :: cs' -> Noeud (ref false, ref [c, creer_branche cs'])
- let ajouter arbre mot =
- let get_tuple_list (Noeud(a, b)) = b in
- let add arbre mot = match arbre, mot with
- | Noeud(a, b), mot' -> (!(get_tuple_list (creer_branche (explode mot))) @ !b; ())
- in add arbre mot
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement