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
What is the answer to 591 ÷ 73
nadezda [96]
<span>8.09 is the answer :)</span>
4 0
3 years ago
Read 2 more answers
Need help please...answer correctly ​
Lelechka [254]

Answer:

9.09

Step-by-step explanation:

x=speed of boat

y=speed of water current

Downstream relative speed = x+y

Upstream relative speed = x-y

Distance remains the same for both upstream and downstream.

a) Distance travelled downstream = speed x time = 3(x+y)

Distance travelled upstream = speed x time = 3.6(x-y)

b) Since both distances are equal, we can write

3(x+y)= 3.6(x-y)

3x+3y = 3.6x-3.6y

6.6y = 0,6x

x=11y: y=x/11

c) Water current has speed as 1/11 times of that of boat

In percent this equals 100/11 = 9.09%

3 0
3 years ago
Read 2 more answers
Find the value of x in the triangle shown below. one angle is 102 and the other angle is 48 and the third one is x
lora16 [44]

Answer:

30

Step-by-step explanation:

Since you know all the angles have to add up to 180 degrees, you add 102 and 48. That is 150. 180 degrees-150 degrees equals 30 degrees.

5 0
3 years ago
Read 2 more answers
The temperature was 6° C.<br> By how much has it fallen if it is now -5° C?
Butoxors [25]

Answer:

11 °C

Step-by-step explanation:

  • Initial temperature = 6 °C
  • Final temperature = - 5°C
  • Change in temperature

= 6 - (-5)

= 6 + 5

= 11 °C

Hope it helps you in your learning process.

8 0
2 years ago
Read 2 more answers
PLS HELP!! :))<br><br> Find the volume......
OLEGan [10]

Answer:

19 + 14 + 10 = 43

Step-by-step explanation:

7 0
3 years ago
Other questions:
  • Side DJ is congruent to which side of CWM
    8·2 answers
  • When the polynomial is written in standard form, what are the values of the leading coefficient and the constant? 5x + 2 - 3x^2
    7·1 answer
  • A ballet company has 30 dancers. They want to randomly sample 8 dancers to complete a survey.
    5·2 answers
  • Point P is the interior of LaTeX: \angle OZQ.\: ∠ O Z Q . If LaTeX: m\:\angle\:OZQ\: m ∠ O Z Q = 125 and LaTeX: m\angle OZP\: m
    15·1 answer
  • The standard form of 6.87 x 10-2 is 0.0687.<br> Question 3 options:<br> True<br> False
    11·1 answer
  • Jordan has a bag of marbles and a spinner. The bag of marbles has 10 marbles in it, 6 of which are red. The spinner is divided i
    7·1 answer
  • The endpoints of a segment are (4,2) and (-2,2). What are the endpoints of the segment after it has been translated 6 units down
    11·1 answer
  • Ill give brainliest if you can help me quick!!!!
    8·1 answer
  • What is 2/9 ÷ 1/2 ???
    7·2 answers
  • Bobby drove 10 miles and his car used up 5 gallons of gas. How many miles cane he drive on 13 gallons of gas
    9·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!