Question: ( 2 0 points ) Assume $n$ is a power of $ 6 $ . Assume we are given an algorithm $f ( n )
points Assume $n$ is a power of $$ Assume we are given an algorithm $fn$ as follows:
beginVerbatim
function fn:
if n:
for i in range:
fn
for i in rangenn:
printBanana
fn
else:
printMonkey
endVerbatim
beginenumeratelabelalph
item What is the running time for this function $fn$ Justify your answer. Hint: Recurrences
beginsolution
Write your answer herevspacept delete this line and replace with your answerwork
endsolution
item How many times will this function print Monkey Please provide the exact number in terms of the input $n$ Justify your answer.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
