// n is a non-negative integer
function f(n)
if n == 0 || n == 1
return 1;
else
return n*f(n-1);
Respond to the following:
In terms of n, how many computational steps areperformed by the f function? Justify yourresponse.Note: One computational step is considered oneoperation: one assignment, one comparison, et cetera. For example,the execution of 3*3 may be considered one computationalstep: one multiplication operation.
What is the Big-O (worst-case) time complexity of the ffunction in terms of n? Justify your response.
Define a recurrence relation an, which isthe number of multiplications executed on the last line of thefunction f, “return n*f(n-1);”, for any giveninput n. Hint: To get
PayPal Gateway not configured
PayPal Gateway not configured