of n = 2¹? [Hint: When input n-1, the number of lines will be printed: P(1) -0. Identify the recurrence relation and find the solution using the iteration method.] function fun(n) if n > 1 print.line('good day') fun (n/2) fun (n/2) end if

COMPREHENSIVE MICROSOFT OFFICE 365 EXCE
1st Edition
ISBN:9780357392676
Author:FREUND, Steven
Publisher:FREUND, Steven
Chapter6: Creating, Sorting, And Querying A Table
Section: Chapter Questions
Problem 10EYK
icon
Related questions
Question

How many lines does the following program print, as a function  

of n = 2¹? [Hint: When input n = 1, the number of lines will be printed: P(1) = 0. Identify the
recurrence relation and find the solution using the iteration method.]
function fun (n)
if n > 1
print.line('good day')
fun (n/2)
fun (n/2)
end if
Transcribed Image Text:of n = 2¹? [Hint: When input n = 1, the number of lines will be printed: P(1) = 0. Identify the recurrence relation and find the solution using the iteration method.] function fun (n) if n > 1 print.line('good day') fun (n/2) fun (n/2) end if
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 4 steps

Blurred answer
Knowledge Booster
Recurrence Relation
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
COMPREHENSIVE MICROSOFT OFFICE 365 EXCE
COMPREHENSIVE MICROSOFT OFFICE 365 EXCE
Computer Science
ISBN:
9780357392676
Author:
FREUND, Steven
Publisher:
CENGAGE L