15.6 Exercises
Doing more practices is the best way to gain intuition when it comes to asymptotics!
Factual
What is the runtime of the following function?
Procedural
Find the runtime of running
print_fib
with for arbitrarily large n.
Do the above problem again, but change the body of the for loop in
print_fib
to be:
Find the runtime of the function
f
on an input of sizen
, given thecreateArray
function as described below:
Metacognitive
What would the runtime of
modified_fib
be? Assume that values is an array of size n. If a value in an int array is not initialized to a number, it is automatically set to 0.
Last updated