# Try Analyze Following Algorithm Function Foo N N 1 Foo N 3 1 N Print B End Foo N 3 End Run Q23508130

Asymptotic running time problem.

Try to analyze the following algorithm. Function Foo (n) if n > 1 then Foo (n/3) for i from 1 to n do Print ‘B’ end Foo(n/3) end a) What is the running time of the function Foo(n)? Give detailed steps to obtain the asymptotic running time in big-theta notation. b) How many ‘A’s will be printed by Foo(n)? Give detailed steps to obtain your solution in big-theta notation (in terms of n).Show transcribed image text Try to analyze the following algorithm. Function Foo (n) if n > 1 then Foo (n/3) for i from 1 to n do Print ‘B’ end Foo(n/3) end a) What is the running time of the function Foo(n)? Give detailed steps to obtain the asymptotic running time in big-theta notation. b) How many ‘A’s will be printed by Foo(n)? Give detailed steps to obtain your solution in big-theta notation (in terms of n).

“We Offer Paper Writing Services on all Disciplines, Make an Order Now and we will be Glad to Help”

0 replies

### Leave a Reply

Want to join the discussion?
Feel free to contribute!