Code Review

Compare your solutions

    #| BEGIN (Введите свое решение) |#
(define (f n)
  (if (< n 3)
  n
  (+ (f (n - 1))
     (* 2 (f (- n 2)))
     (* 3 (f (- n 3))))))

(define (f-iter n)
  (define (f-iter-count a b c count)
    (if (= count 2)
        c
        (f-iter-count b c (+ (* 3 a) (* 2 b) c) (- count 1))))
  (if (< n 3)
      n
      (f-iter-count 0 1 2 n)))
#| END |#