Question: Consider the following recursive procedure. BLA(n): if n = 1 then return 1 else return BLA(n 1) + BLA(n 1) + BLA(n
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)"?Step by Step Solution
3.38 Rating (154 Votes )
There are 3 Steps involved in it
Lets tackle each part of the problem stepbystep to answer the questions comprehensively Part a What function of n does BLA compute The recursive proce... View full answer
Get step-by-step solutions from verified subject matter experts
