Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- let rec bij = function
- | (0, 0) -> 0
- | (0, y) -> bij (y-1, 0)+1
- | (x, y) -> if x <= y then bij (x-1, y)+1 else bij(x, y+1)+1;;
- print_int(bij(4,1));;
- (* voila tres bien *)
- let rec lexico = fun (* renvoie true si l1 > l2 *)
- | [] [] -> true
- | [] l -> true
- | l [] -> false
- | (t::q) (t2::q2) -> if t > t2 then true
- else
- if t < t2 then false
- else
- lexico q q2;;
- let rec ack = fun
- | 0 p -> p+1
- | n 0 -> ack (n-1) 1
- | n p -> ack (n-1) (ack n (p-1));;
- print_int(ack 4 4);;
Advertisement
Add Comment
Please, Sign In to add comment