Question

1. Find the Big Oh notation for the expressions below A. 10,000,000 B. 1+2+3+4+...+n C. 50,000+log(n^2000)+500n...

1. Find the Big Oh notation for the expressions below

A. 10,000,000

B. 1+2+3+4+...+n

C. 50,000+log(n^2000)+500n

D. 5,000(n^2)+7,000,000

E. 700n^3+n^2+50,000,000n+1

F. 2^(n+3)+300(n^3)

2. Identify time complexity in Big O notation for the program segments

A.

sum=0;

for(i=1;i<=n;i=i*3)

     sum++;

B.

sum=0;

for(int i=1;i<3^n;i=i*3)

    sum=sum++;

for (int j=n;j<0;j--)

    sum--;

C.

sum=0;

for(i=n;i>=1;i--)

    for(j=i;j<=n;j++)

        sum++;

D.

sum=0;

for(i=1;i<=10;i++)

    for(int j=1; j<=n*n; j++)

         sum++;

0 0
Add a comment Improve this question Transcribed image text
Know the answer?
Add Answer to:
1. Find the Big Oh notation for the expressions below A. 10,000,000 B. 1+2+3+4+...+n C. 50,000+log(n^2000)+500n...
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
  • find complexity Problem 1 Find out the computational complexity (Big-Oh notation) of the code snippet: Code...

    find complexity Problem 1 Find out the computational complexity (Big-Oh notation) of the code snippet: Code 1: for (int i = n; i > 0; i /= 2) { for (int j = 1; j < n; j *= 2) {     for (int k = 0; k < n; k += 2) {               // constant number of operations here     } } } Code 2: Hint: Lecture Note 5, Page 7-8 void f(int n) { if (n...

  • Show the Big O Complexity of the following functions and loop constructions: (Please show work and...

    Show the Big O Complexity of the following functions and loop constructions: (Please show work and explain) a. f(n) = 2n + (blog(n+1)) b. f(n) = n * (log(n-1))/2 c. int sum = 0; for (int i=0; i<n; i++) sum++; for (int j=n; j>0; j /= 2) sum++; d. int sum = 0; for (int i=n; i>0; i--) for (int j=i; j<n; j *= 2) sum++;

  • They NAME sc 162- lec. 18 (Big quiz 1. Arrange the following functions in order of...

    They NAME sc 162- lec. 18 (Big quiz 1. Arrange the following functions in order of increasing rate of growth. Also, identify any functions with the SAME rate of growth by putting then below the others. a) sn, 44log n, 10n log n, 500, 2n, 28, 3n b) n', n +2 nlog2 n, n! ne log, n, n n n'. 4", n, na, 2 2. Use the Big-o notation to estimate the time complexity for the following segments/methods. (Assume all...

  • Using C++ please explain What is the Big-O time complexity of the following code: for (int...

    Using C++ please explain What is the Big-O time complexity of the following code: for (int i=0; i<N; i+=2) { ... constant time operations... Select one: o a. O(n^2) O b. O(log n) c. O(n) O d. 0(1) What is the Big-O time complexity of the following code: for(int i=1; i<N; i*=2) { ... constant time operations... Select one: O O a. O(n^2) b. 0(1) c. O(n) d. O(log n) O What is the Big-O time complexity of the following...

  • . Big O Notation.Thanks to Reges, Building Java Programs, 2nd edition. Estimate the big-O complexity for...

    . Big O Notation.Thanks to Reges, Building Java Programs, 2nd edition. Estimate the big-O complexity for each of these algorithms, and justify your answer. To confirm your calculations, answers are provided at the end of the rubric. Your justification can be mathematical or written, formal or informal. Rubric: Correct Big-O classification of four problems Justification of four problems Big-O categories: 3.1. O(log n). 3.2. O(n). 3.3. O(n2). 3.4. O(1) Problem Code fragment 3.1 int sum = 0; int j =...

  • **C++ Question** For all of the following, determine the total operation count and then the Big-O...

    **C++ Question** For all of the following, determine the total operation count and then the Big-O of the given code segments: a. for (int j = 0; j < n; j++) for (int k = 0; k < j; k++) sum++; b. for (int i = 0; i < q*q; i++) for (int j = 0; j < i; j++) sum++; For all of the following, just determine the Big-O of the given code segments: c. for (int i =...

  • 4. Big-Oh and Rune time Analysis: describe the worst case running time of the following pseudocode...

    4. Big-Oh and Rune time Analysis: describe the worst case running time of the following pseudocode functions in Big-Oh notation in terms of the variable n. howing your work is not required (although showing work may allow some partial t in the case your answer is wrong-don't spend a lot of time showing your work.). You MUST choose your answer from the following (not given in any particular order), each of which could be re-used (could be the answer for...

  • Which big-O expression best characterizes the worst case time complexity of the following code? public static...

    Which big-O expression best characterizes the worst case time complexity of the following code? public static int foo(int N) ( int count = 0; int i1; while (i <N) C for (int j = 1; j < N; j=j+2) { count++ i=i+2; return count; A. O(log log N) B. O(log N2) C. O(N log N) D. O(N2)

  • 1. Order following function by growth rate: N, √N, N1.5, N log (N), log (log (N)),...

    1. Order following function by growth rate: N, √N, N1.5, N log (N), log (log (N)), log (N) log (N), N2, 2N, 200, NN 2. Give a useful Θ (big Theta) estimation for each of following function t(n). a. t(n) = 122 * 212 b. t(n) = 2log2(n2) + log4(n ) + (log2 n) 2 + (log2 (202)) 2 c. t(n) = 3t(n/2) + n d. t(n) = 3t(n/2) + (n+1)(n-1) e. t(n) = 4t(n/2) + (n2 + n-1) f....

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