Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I think it's T(n) = 2T(n/3)+n but I'm not sure I'm doing it right...and I'm not sure what to do afterwards. 4. How many times

image text in transcribed

I think it's T(n) = 2T(n/3)+n but I'm not sure I'm doing it right...and I'm not sure what to do afterwards.

4. How many times does the following program print "still going"? Express your answer as a function of n (in O(.) form function f (n) if n>1: for i=0 to n-1: print_line ('still going' ') f (n/3) f (n/3) Hint: Let T(n) be the number of times that the function f(n) will print "sll going". You need to write a recurrence for T(n) and solve it (using any method you like). You may assume n is a power of 3

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions