Write tail-recursive versions of the following: (a) (b) ;; compute integer log, base 2 ;; (number of

Question:

Write tail-recursive versions of the following:

(a)

;; compute integer log, base 2 ;; (number of bits in binary representation) ;; works only for positive integers (define log2 (lambda (n) (if (= n 1) 1 (+ 1 (log2 (quotient n 2))))))

(b)

Fantastic news! We've Found the answer you've been seeking!

Step by Step Answer:

Related Book For  book-img-for-question
Question Posted: