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
zhuklara [117]
3 years ago
7

Give a big-O estimate for the number additions used in this segment of an algorithm.

Computers and Technology
1 answer:
rjkz [21]3 years ago
3 0
Big-O notation is a way to describe a function that represents the n amount of times a program/function needs to be executed. 

(I'm assuming that := is a typo and you mean just =, by the way) 

In your case, you have two loops, nested within each other, and both loop to n (inclusive, meaning, that you loop for when i or j is equal to n), and both loops iterate by 1 each loop.

This means that both loops will therefore execute an n amount of times. Now, if the loops were NOT nested, our big-O would be O(2n), because 2 loops would run an n amount of times.

HOWEVER, since the j-loop is nested within i-loop, the j-loop executes every time the i-loop <span>ITERATES. 
</span>
As previously mentioned, for every i-loop, there would be an n amount of executions. So if the i-loop is called an n amount of times by the j loop (which executes n times), the big-O notation would be O(n*n), or O(n^2). 

(tl;dr) In basic, it is O(n^2) because the loops are nested, meaning that the i-loop would be called n times, and for each iteration, it would call the j-loop n times, resulting in n*n runs.

A way to verify this is to write and test program the above. I sometimes find it easier to wrap my head around concepts after testing them myself.
You might be interested in
When your friend DaJuan turns on his computer, he hears four beeps. The computer won’t fully boot. DaJuan has a Dell computer wi
djyliett [7]

Answer:

4 beeps indicate a Memory Read / Write failure. Try re-seating the Memory module by removing and reinserting it in the slot. This could mean it could've just jiggled loose after a while or dust, there could be a hundred other problems but those are the two most common.n:

6 0
3 years ago
Convert 234.43 (base 7) to base 10
miss Akunina [59]

Answer:

123.6326

Explanation:

Given number in base 7 : 234.43

Converting to base 10:

Each digit needs to be multiplied by 7^(position index)

Applying this for all the digits in the number:

=2* 7^2 + 3*7^1 + 4*7^0 + 4*7^-1 + 3*7^-2

=2*49 + 3*7 + 4 + 4/7+3/49

=98 + 21 + 4 + 0.5714 + 0.0612

Separating the integer and fraction parts:

=(98 + 21 + 4) + (0.5714 + 0.0612)

=123.6326

So the base 10 equivalent value for 234.43(base 7) is 123.6326

7 0
3 years ago
What does the "configure dhcp options for proxy dhcp" option do?
ZanzabumX [31]
You should select the configure DHCP options for proxy DHCP option if the local DHCP server is a Microsoft DHCP server, if you select this option the DHCP server is automatically configured to forward the PXE requests to the WDS server. If the local DHCP server is not a Microsoft DHCP server, you have to configure the DHCP server manually to forward the request to the WDS server. 
5 0
3 years ago
What are your strongest competencies? What will you do them? <br>❌NONSENSE ANSWER<br>​
Anna [14]

Answer:

1. Teamwork

2. Responsibility

3. Commercial Awareness

4. Decision Making

5. Communication

6. Leadership

7. Trustworthiness & Ethics

8. Results Orientation

9. Problem Solving

10. Organisational skills

8 0
2 years ago
Analyze the following code. Which of the following statements is correct?
matrenka [14]

Answer:

that is complex wow

Explanation:

8 0
3 years ago
Other questions:
  • What type of attack intercepts communication between parties to steal or manipulate the data?
    13·1 answer
  • What are the advantages and disadvantages of malware maintenance?
    12·1 answer
  • One of the disadvantages of an e-marketplace is that it cannot provide a single platform for prices. true or false?
    10·2 answers
  • Anybody good with Microsoft excel? I need help with this class.
    9·2 answers
  • How do you think computers have helped improve documentation, support and services within the healthcare industry
    13·1 answer
  • 20.
    8·1 answer
  • Mario kart is mercedes lol
    13·2 answers
  • 4. Compute the following additions
    7·1 answer
  • What is an advantage of using a fully integrated cloud based data analytics platform
    5·1 answer
  • Discuss the advantages and disadvantages of supporting links to files that cross mount points (that is, the file link refers to
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!