Question

a) Prove that running time T(n)=n3+30n+1 is O(n3) [1 mark] b) Prove that running time T(n)=(n+30)(n+5)...

a) Prove that running time T(n)=n3+30n+1 is O(n3) [1 mark]

b) Prove that running time T(n)=(n+30)(n+5) is O(n2) [1 mark]

c) Count the number of primitive operation of algorithm unique1 on page 174 of textbook, give a big-Oh of this algorithm and prove it. [2 mark]

d) Order the following function by asymptotic growth rate [2 mark]

a. 4nlogn+2n

b. 210

c. 3n+100logn

d. n2+10n

e. n3 f. nlogn

0 0
Add a comment Improve this question Transcribed image text
Answer #1


f(n) = O(g(n)) means there are positive constants c and n0, such that 0 ≤ f(n) ≤ cg(n) for all n ≥ n0

n^3+30n+1 is O(n^3)

=>  n^3+30n+1 <= c(n^3)

Let's assume c = 2
=>  n^3+30n+1 <= c(n^3)
=>  n^3+30n+1 <= 2(n^3)
=>  30n+1 <= n^3

n^3 is greater than 30n+1 for all n >= 6

so, n^3+30n+1 is O(n^3) for all c = 2 and n0 = 6 

Add a comment
Know the answer?
Add Answer to:
a) Prove that running time T(n)=n3+30n+1 is O(n3) [1 mark] b) Prove that running time T(n)=(n+30)(n+5)...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Question2 0/5 pts If exact running time of an algorithm is T(n)-5n3+ n2 + 3n -5...

    Question2 0/5 pts If exact running time of an algorithm is T(n)-5n3+ n2 + 3n -5 where n is the input size, then which of the following is true? T(n)- O(n) RCOECEQuestion 3 0/5 pts Which of the following is the correct ranking of the functions listed below: logn. n2 n2n, 2. 1500. nlogn, 5 Question 4 5/5 pts to search

  • 1 question) Arrange the following in the order of their growth rates, from least to greatest:...

    1 question) Arrange the following in the order of their growth rates, from least to greatest: (5 pts) n3                     n2         nn        lg n     n!       n lg n              2n                     n 2 question)Show that 3n3 + n2 is big-Oh of n3. You can use either the definition of big-Oh (formal) or the limit approach. Show your work! (5 pts.) 3 question)Show that 6n2 + 20n is big-Oh of n3, but not big-Omega of n3. You can use either the definition of big-Omega...

  • What is the average running time for quicksort? O(1) O(log10N) O(log2N) O(log2N) O(N) O(N log N)...

    What is the average running time for quicksort? O(1) O(log10N) O(log2N) O(log2N) O(N) O(N log N) O(N2) O(N3) O(Nk) O(2N) O(N!)

  • Analyze and prove the running time of the recursive formula T(n) = n2 + 2T(n/2). (hint-...

    Analyze and prove the running time of the recursive formula T(n) = n2 + 2T(n/2). (hint- first prove that it is O(n2 logn). Next see if you could improve your answer. We used the recursion tree method to analyze the running time of MergeSort. Use this method to analyze each one of the following recursive formulas, and obtain its solution. Assume T(n) = 1 when n ≤ 1. Analyze and prove the running time of the recursive formula T(n) =...

  • What is the worst case running time of a linear search? O(1) O(log10N) O(log2N) O(log2N) O(N)...

    What is the worst case running time of a linear search? O(1) O(log10N) O(log2N) O(log2N) O(N) O(N log N) O(N2) O(N3) O(Nk) O(2N) O(N!)

  • What is the worst case running time of a binary search? O(1) O(log10N) O(log2N) O(log2N) O(N)...

    What is the worst case running time of a binary search? O(1) O(log10N) O(log2N) O(log2N) O(N) O(N log N) O(N2) O(N3) O(Nk) O(2N) O(N!)

  • 1. a) Let f(n) = 6n2 - 100n + 44 and g(n) = 0.5n3 . Prove...

    1. a) Let f(n) = 6n2 - 100n + 44 and g(n) = 0.5n3 . Prove that f(n) = O(g(n)) using the definition of Big-O notation. (You need to find constants c and n0). b) Let f(n) = 3n2 + n and g(n) = 2n2 . Use the definition of big-O notation to prove that f(n) = O(g(n)) (you need to find constants c and n0) and g(n) = O(f(n)) (you need to find constants c and n0). Conclude that...

  • Question 3: Given the following two code fragments [2 Marks] (i)Find T(n), the time complexity (as...

    Question 3: Given the following two code fragments [2 Marks] (i)Find T(n), the time complexity (as operations count) in the worst case? (ii)Express the growth rate of the function in asymptotic notation in the closest bound possible. (iii)Prove that T(n) is Big O (g(n)) by the definition of Big O (iv)Prove that T(n) is (g(n)) by using limits

  • Please use java language to answer these qustions, and then test the code if it need...

    Please use java language to answer these qustions, and then test the code if it need code (like qustion 2) to make suer the code work fine and type the answer please 1- Order the following functions by asymptotic growth rate. Explain your answer. 4n log n 210          2log n       3n + 100 log n 4n 2n n2 + 10n n3   n log n 2-Implement a method with signature transfer (S, T) that transfers all elements? Please use java language...

  • Let f(n) = 5n^2. Prove that f(n) = O(n^3). Let f(n) = 7n^2. Prove that f(n)...

    Let f(n) = 5n^2. Prove that f(n) = O(n^3). Let f(n) = 7n^2. Prove that f(n) = Ω(n). Let f(n) = 3n. Prove that f(n) =ꙍ (√n). Let f(n) = 3n+2. Prove that f(n) = Θ (n). Let k > 0 and c > 0 be any positive constants. Prove that (n + k)c = O(nc). Prove that lg(n!) = O(n lg n). Let g(n) = log10(n). Prove that g(n) = Θ(lg n). (hint: ???? ? = ???? ?)???? ?...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT