let rec coupe = function | [] -> ([],[]) | a::q -> let (l,l') = coupe q in (a::l',l) ;; let rec merge = function | [],l -> l | l,[] -> l | a::q,x::t -> if a < x then a::(merge (q,x::t)) else x::(merge (a::q,t)) ;; let rec tri = function | [] -> [] | [a] -> [a] | l -> let l,l' = coupe l in merge (tri l,tri l') ;; let daniel l = let rec filtre max_dif = function | [] -> [] | (a,b)::q -> if b > max_dif then (a,b)::(filtre b q) else (filtre max_dif q) in filtre (-1) (tri l) ;; daniel [2,1;1,2;3,3;4,4;0,0]