Guest User

Untitled

a guest
Jan 19th, 2019
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.33 KB | None | 0 0
  1. let rec fusion (liste1,liste2) =
  2. match (liste1,liste2) with
  3. ([],l) | (l,[]) -> l
  4. | ((nom1,accompte1)::l1,(nom2,accompte2)::l2) ->
  5. match compare nom1 nom2 with
  6. 0 -> (nom1,accompte1 +. accompte2)::fusion (l1,l2)
  7. | (-1) -> (nom1,accompte1)::fusion (l1,liste2)
  8. | _ -> (nom2,accompte2)::fusion (liste1,l2);;
Add Comment
Please, Sign In to add comment