Tuesday, October 22, 2019

SICP in Clojure: Chapter 1, Exercise 26

This is my Clojure solution to Chapter 1, Exercise 26:

(ns sicp.ch1.ex26)

;; By replacing the call to square with an explicit multiplication,
;; we've changed the resultant process from a linear recursive

;; process to a tree recursion which changes the running-time from
;; O(log n) to O(log 2^n) = O(n).

No comments: