diff options
author | Teddy <[email protected]> | 2013-08-12 08:47:24 +0800 |
---|---|---|
committer | Teddy <[email protected]> | 2013-08-12 08:47:24 +0800 |
commit | b27fd8f7572ee4774e1bdb635b0d9eda4339734a (patch) | |
tree | bfdb417705a4c8fb1b0d394568505a593f80616f /robust_test.scm | |
parent | 76977635e28e06192a486a9452e03bc7b8f612dc (diff) |
manual hash approach is even slower than STL mapfaster_fetch
Diffstat (limited to 'robust_test.scm')
-rw-r--r-- | robust_test.scm | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/robust_test.scm b/robust_test.scm index 6dd4abf..4b68c4e 100644 --- a/robust_test.scm +++ b/robust_test.scm @@ -229,3 +229,24 @@ src (list x) x (cons x x) + +(define (f x) + (if (<= x 2) 1 (+ (f (- x 1)) (f (- x 2))))) +(f 1) +(f 2) +(f 3) +(f 4) +(f 5) + +(define (g n) + (define (f p1 p2 n) + (if (<= n 2) + p2 + (f p2 (+ p1 p2) (- n 1)))) + (f 1 1 n)) + +(define (all i n) + (if (= n i) + #f + (and (display (g i)) (all (+ i 1) n)))) +(all 1 100) |