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

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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!