Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- let rec rapikan = function
- | [] -> []
- | [(p, k)] -> if k = 0.0 then [] else [(p, k)]
- | (p1, k1)::(p2, k2)::t -> if p1 = p2 then
- if k1+k2 = 0.0 then rapikan t
- else (p1, k1+k2)::rapikan t
- else
- if k1 = 0.0 then rapikan ((p2, k2)::t)
- else (p1, k1)::rapikan ((p2, k2)::t);;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement