Created
January 22, 2011 21:19
-
-
Save shirok/791492 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(define (ack m n) | |
(cond ((zero? m) (+ n 1)) | |
((zero? n) (ack (- m 1) 1)) | |
(else (ack (- m 1) (ack m (- n 1)))))) | |
#| | |
gosh> (time (ack 3 10)) | |
;(time (ack 3 10)) | |
; real 6.488 | |
; user 6.480 | |
; sys 0.010 | |
8189 | |
gosh> (time (ack 1 2)) | |
;(time (ack 1 2)) | |
; real 0.000 | |
; user 0.000 | |
; sys 0.000 | |
4 | |
gosh> (time (ack 4 1)) | |
;(time (ack 4 1)) | |
; real 419.934 | |
; user 419.470 | |
; sys 0.430 | |
65533 | |
|# | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment