(setq L '(3 7 + 4 2 + *))
(setq M '(4 3 7 + * 2 -))
+(setq N '(10 10 5 / +))
(define (calculExp P L)
(cond
((null? L) P)
(println (calculExp '() L))
;(trace true)
(println (calculExp '() M))
+(println (calculExp '() N))
+
+;(trace nil)
+
+(setq Q '(+ (* x 0) (* 10 (+ y 0))))
+(define (algsimplificator L)
+ (cond
+ ((null? L) '())
+ ((= (first L) ) (rest L))
+
+ ))
+(println "algsimplificator")
+;(println algsimplificator(Q))
+
+(define (fibonacci N)
+ (cond
+ ((= N 0) 0)
+ ((= N 1) 1)
+ ((> N 1) (+ (fibonacci (- N 1)) (fibonacci (- N 2))))))
+(println "fibonacci")
+;(println (fibonacci 21))
+;(println (fibonacci 14))
+(println (fibonacci 20))
+(println (time (fibonacci 20)))
+
+;(trace true)
+
+(define (fibo:fibo n)
+ (if (not fibo:mem) (set 'fibo:mem '(0 1)))
+ (dotimes (i (- n 1))
+ (push (+ (fibo:mem -1) (fibo:mem -2)) fibo:mem -1))
+ (last fibo:mem))
+(println "fibo")
+(println (fibo 20))
+(println (time (fibo 20)))
;(trace nil)