1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Nonamiya [84]
3 years ago
10

Give a big-O estimate for the number of operations, where an operation is a comparison or a multiplication, used in this segment

of an algorithm (ignoring comparisons used to test the conditions in the for loops, where a1, a2, ..., an are positive real numbers). m :
Mathematics
1 answer:
kap26 [50]3 years ago
8 0

Answer:

O(n2)

Step-by-step explanation:

the first iteration algorithm of the i-for loop (the outer loop), the j-for loop (the inner loop) will run 2 to

n times which is represented as

(n − 1 times).

the second iteration algorithm of the i-for loop, the j-for loop will run 3 to n times represented as

(n − 2 times).

the third to the last iteration algorithm of the i-for loop, the j-for loop will run n − 1 to n times (2 times).

And the second to the last iteration of the i-for loop, the j-for loop will run from n to n times (1 time)

For the last iteration of the i-for loop, the j-for loop will run 0 times because i + 1 > n.

Now we know that the number of times the loops are run is

1 + 2 + 3 + . . . + (n − 2) + (n − 1) = n(n − 1)/2

So we can express the number of total iterations as n(n − 1)/2.

Since we have two operations per loop (one comparison and one multiplication), we have

2 ·n(n−1)/2 = n

2 − n operations.

So f(n) = n2 − n

f(n) ≤ n2

for n > 1.

Therefore, the algorithm is O(n2) with

C = 1 and k = 1.

You might be interested in
Ayudaaa plis<br>7-4= <br>6-2=<br>-3-2=<br>-8+9=<br>-9+5=<br>1+10=​
vladimir2022 [97]

Answer:

7-4=3

6-2=4

-3-2= -5

-8+9=1

-9+5= -4

1+10=11

Step-by-step explanation:

No es tan difícil, puedes g0oglearlo

6 0
3 years ago
Read 2 more answers
Jennifer earned $1000 babysitting over the summer. She spent $250 of her earnings on new clothes. What percent of her earnings d
emmainna [20.7K]

Answer:

25%

Step-by-step explanation:

she earned $1,000

she spent $250

250/1000 = 0.25

0.25 x 100 = 25%

4 0
3 years ago
Read 2 more answers
Round 2.408 to the nearest hundredth
Verdich [7]
8 in 2.408 is closer to 10, so you round 2.408 to 2.41
7 0
3 years ago
Read 2 more answers
Can someone help me with these questions immediately? Thank you!
Scrat [10]

Answer:

35

................................................

5 0
3 years ago
Reflect AQ'R'S' if Q'(1, -3), R'(-2,-6),<br> and S'(-1,-1) over the x-axis.
castortr0y [4]

Answer:

Step-by-step explanation:

The rule of reflecting over the x-axis is that point (x, y) →( x, -y) so

Q'(1, -3), R'(-2,-6),and S'(-1,-1) reflected over the x-axis, become

Q"(1, 3), R"(-2, 6), and S"(-1, 1) .

6 0
3 years ago
Other questions:
  • Find the measure of the requested angle.
    6·1 answer
  • Solve for u . 3u+11=41
    15·2 answers
  • Find f(-2).<br><br><br><br> 4<br><br><br> 8<br><br><br> 10<br><br><br> 20
    6·1 answer
  • How do you do number 15 and 17? Help please?
    10·1 answer
  • The bottom one says 9/2 so please help with these questions, I have more on my profile.
    7·1 answer
  • If a car weighs 1500 pounds, rank the following scale weights from most accurate to least accurate.1505 pounds1600 pounds1497.8
    15·1 answer
  • Can someone help me please
    14·1 answer
  • How many pairs of parallel lines have in a trapezoid
    9·2 answers
  • Help answering these math questions
    12·2 answers
  • Bro it easy just look
    13·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!