Search:

Type: Posts; User: helloworld922

Search: Search took 0.09 seconds.

  1. Re: Big O notation... can you check my answers for each code segment?

    The reasoning for 1 is a bit convoluted. It is O(n) because you are running it half the time: O(n/2). But big-O drops the constant factors, so we're left with O(n)

    #5 is not O(n^2). O(n^3) isn't a...
  2. Re: Big O notation... can you check my answers for each code segment?

    1 is wrong. Hint: write out the expression for how many times the loop executes.

    3 I'm assuming you meant the inner loop to be 0 to n*n (a.k.a. n squared)? If so, yes it is n cubed.

    5 I think...
Results 1 to 2 of 2