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
Reading for comprehension requires _____ reading?
Levart [38]

Answer:

IT is ACTIVE

Explanation: I took the quiz

4 0
2 years ago
Force field meaning in science fiction
expeople1 [14]
In science fiction, a force field is a defensive barrier made up of energy. They are used to protect, people, an area, animals, etc from an attack or a destructive impact.
5 0
3 years ago
Exam Instructions
SIZIF [17.4K]

A diagram which indicates the sequence in which milk travels through a production plant to each stage of a cheese manufacturing process is: D. A process schedule

<h3>What is a process schedule?</h3>

A process schedule can be defined as a type of diagram (schematic) which is designed and developed to illustrate the various processes and stages (steps) that are associated with manufacturing of a particular product.

In this context, a process schedule is a diagram which would most likely indicate the sequence in which milk travels through a production plant to each stage of a cheese manufacturing process.

Read more on cheese manufacturing here: brainly.com/question/21148228

#SPJ1

7 0
1 year ago
IF YOU COULD CREATE A SOCIAL NETWORK:, what would it be like? What would make it so special about the others? (If you want you c
frosja888 [35]

It would be like instagram

3 0
3 years ago
What is the least number of bits you would need to borrow from the network portion of a Class B subnet mask to get at least 130
Tatiana [17]

Answer: Eight

Explanation:

A class B address is 255.255.0.0. We need to borrow 8 bits from the network portion to have atleast 130 host per subnet.

11111111.00000000.00000000.00000000

8 0
3 years ago
Other questions:
  • There are many differenttypes of models, but an individual DSS can consist of onlyone.
    15·1 answer
  • Consider the following network: proxy-cache On average there are 35 objects downloaded per second, and the average object size i
    14·1 answer
  • CNG and gasoline-powered vehicles use the same internal combustion engine, but different fuel types. A) True B) False
    8·2 answers
  • The most fundamental components of storage that users interact with are the:
    11·1 answer
  • PLEASE HELP FAST !!!!!!!!!!
    12·1 answer
  • What are attribute grammars used for?
    8·1 answer
  • Which of the following allows the transmission of voice and often video communication over the internet?
    12·1 answer
  • What can you do to help create a safe online environment?
    8·2 answers
  • Why are formulas used in spreadsheets?
    10·1 answer
  • ( BRAINLIEST) <br> Name 2 input devices and 2 output devices on a smart phone.
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!