# How many lines does his algorithm print? Write a recurrence and solve it.function printaton(n: an integer power of 2) {               if n > 1 {                      printaton(n/2)                       printaton(n/2)                      printaton(n/2)                      for i = 1 to n ^ 4 do                            printline("are we done yet?")                }} a. Use Master's theorem to obtain an asymptotic solution. b. Derive an exact solution by expanding the recurrence.

Question

How many lines does his algorithm print? Write a recurrence and solve it.
function printaton(n: an integer power of 2) {
if n > 1 {
printaton(n/2)
printaton(n/2)
printaton(n/2)
for i = 1 to n ^ 4 do
printline("are we done yet?")
}
}

a. Use Master's theorem to obtain an asymptotic solution.

b. Derive an exact solution by expanding the recurrence.

### Want to see this answer and more?

Step-by-step answers are written by subject experts who are available 24/7. Questions are typically answered in as fast as 30 minutes.* 