Question: I need help with C, D, & E 1. Consider the function f(n) defined as follows, where n is a nonnegative integer: nSI n is
1. Consider the function f(n) defined as follows, where n is a nonnegative integer: nSI n is even, n>1 nisold, n > 1 f() + f () (a) Draw a box trace diagram showing the evaluation of f(1). Give the value of the expression(11).15 points (b) List the calls in the order made. How many calls are made to the function? [5 points] (c) Give the multiplicities of the calls for each value of n. [5 points (d) Suppose each call to the function is memoized as (11) is evaluated. Draw the box trace diagram for the evaluation of this version of the expression. [5 points (e) How many calls are made for this version? How many fewer calls are made using the memoized version? [5 points]
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
