Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

sing Big Oh notation, what is the tightest upper bound for the running time of the below function fun? def fun ( n ) :

sing Big Oh notation, what is the tightest upper bound for the running time of the below function fun?
def fun(n): # n is a positive integer
count =0
i = n
while i >0:
for j in range(n):
count +=1
i //=4 # Integer division rounds down
return count
Group of answer choices
O(n log n)
Unbounded
O(log n)
O(n^2)
O(n)

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

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

a. Compute = E(Y).

Answered: 1 week ago