Consider the following recursive procedure. BLA(n): if n = 1 then return 1 else return BLA(n
Fantastic news! We've Found the answer you've been seeking!
Question:
Consider the following recursive procedure.
BLA(n): if n = 1 then return 1
else return BLA(n — 1) + BLA(n — 1) + BLA(n — 1)
(a) What function of n does BLA compute?
(b) What is the running time T(n) of BLA?
(c) How do the answers to (a) and (b) change if we replace the last line by "else return 3 . BLA(n — 1)"?
Related Book For
Computer Organization and Design The Hardware Software Interface
ISBN: 978-0124077263
5th edition
Authors: David A. Patterson, John L. Hennessy
Posted Date: