; Both of these are recursive procedures. One of them uses a recursive process,
; the other one uses an iterative process. Both v1 and v2 compute a * 2^n.
;
; Discuss with your partner which function uses which process. Also, what
; is the order of growth in terms of time of version 1? What is the order of
; growth in terms of time for version 2? Are the orders of growth the same
; in terms of memory used? Justify your answers.
(define (v1 a n) (cond ((= n 0) a) (else (v1 (* 2 a) (- n 1))))) (define (v2 a n) (cond ((= n 0) a) (else (* 2 (v2 a (- n 1))))))