Question: Consider this function, and then answer the questions that follow. (For the sake of simplicity, don't worry about issues with integer overflow here.) int floofy(int

Consider this function, and then answer the questions that follow. (For the sake of simplicity, don't worry about issues with integer overflow here.) int floofy(int n) if (n = 1) return n * 2; return floofy(n-1) * floofy(n-1); (a) Using big-oh notation, what is the runtime of this function? (You don't have to justify your answer.) (b) What slight modification can you make to the code above to drastically reduce its runtime? (Re-write the function in the space above with your modification. Don't change it to an iterative function, though! Keep it recursive.) (c) Using big-oh notation, what is the runtime of the function using the modification you proposed in part (b)? (Again, you don't have to justify your answer.)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
