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
zloy xaker [14]
3 years ago
12

What is the f(n) runtime of the following pseudocode: sum = 0 for A = N/2 downto 1 for B = 1 to 4N increment sum by B

Mathematics
1 answer:
nikitadnepr [17]3 years ago
5 0

Answer:

f(N) = 2+ N/2 + 6N² units of time.

Step-by-step explanation:

Assigning 0 to the variable sum takes one unit of time.

Each time you increment sum by B, you need to call the value of sum, sum it to B and assign it to sum, which takes three units of time in total. You are repeating this process for each value of B which ranges from 1 to 4n and for each value of A which ranges from 1 to n/2. Opening the FOR takes also another unit of time, so, as a result, we have

f(N) 1 + 1 (open the FOR in A)+ N/2*(1 (open the FOR in B) + 4N*3) = 2+ N/2 + 6N² units of time. It has order complexity O(N²).

You might be interested in
(2m^4) • m3<br> Need help ASAP I have the answer but I need help showing work
hichkok12 [17]

Answer:

4m^11

Step-by-step explanation:

2m^4.2 you multiply powers in paranthesis

2m^8 result

2m^8.m^3

You add the exponents together because it is same base and put the 4 because 2 to the power of 2 is 4

4m^11

4 0
3 years ago
Read 2 more answers
At the pie eating contest, Max ate 2⁄5 of a pie and Jen ate 6⁄8 of a pie. How many pies did they eat all together?
Brums [2.3K]
I think you have to find a common multiple for the denominators 5 and 8 which would be 40. so it would be 6/40 and 2/40. then I think, you  would add or multiple, depending on the situation, 6 and 2
6 0
3 years ago
Read 2 more answers
What is the answer plz???
vladimir2022 [97]

Answer:

the answer is 5.28

Step-by-step explanation:

5.28 here you go may be late

5 0
3 years ago
Two of the sides of a right triangle are 8 and 6 units long. How long is the third side? Find all possible answers.
Lana71 [14]

Answer:

10 units.

2√7 units.

- (or 5.29 units to the nearest hundredth)

Step-by-step explanation:

If the 2 sides are legs of the triangle ( that is they are at 90 degrees to each other) the third side, by Pythagoras  theorem:

=  √(6^2 + 8^2)

=  √100

= 10 units.

The other possibility is that 8 is the length of the hypotenuse, in which case

The third side

=  √(8^2 - 6^2)

=  √28

= 2√7 units.

3 0
3 years ago
Tammy baked a batch of 20 cupcakes. Daniella baked
ElenaW [278]

Multiplication is the process of multiplying. The total number of cupcakes that are produced by the 3 girls is 44.

<h3>What is multiplication?</h3>

Multiplication is the process of multiplying, therefore, adding a number to itself for the number of times stated. For example, 3 × 4 means 3 is added to itself 4 times, and vice versa for the other number.

Given that Tammy baked a batch of 20 cupcakes and Daniella baked 4/5 as many cupcakes as Tammy. Therefore, the number of cupcakes made by Daniella is,

Number of cupcakes made by Daniella

= (4/5)×(Number of cupcakes made by Tammy)

= (4/5) × 20

= 16

Now, if Miko baked 1/2 as many cupcakes as Daniella. Therefore, the number of cupcakes made by Miko is,

Number of cupcakes made by Miko

= (1/2) × (Number of cupcakes made by Daniella)

= (1/2) × 16

= 8

Further, the total number of cupcakes that are produced are,

Number of cupcakes = 20 + 16 + 8 = 44

Hence, the total number of cupcakes that are produced by the 3 girls is 44.

Learn more about Multiplication here:

brainly.com/question/14059007

#SPJ1

8 0
1 year ago
Other questions:
  • What is the area of the triangular section ?
    6·2 answers
  • A rational number can be written as the ratio of on BLANK to another.
    15·1 answer
  • Looking at Yari's equation below, what
    6·1 answer
  • Julia enjoys shooting paper balls into the wastebasket across her office. She misses the first shot 50% of the time. When she mi
    15·1 answer
  • Write the equation of a circle with center (4, -5) and radius = square root of 13
    15·2 answers
  • Someone must have beaten me here. Devora thinks, dismayed by the empty treasure chest. Then, just as she's about to close the li
    10·1 answer
  • Please show me how you do this question
    13·2 answers
  • Solve and then answer the questions​
    15·1 answer
  • Hi I'm new uhm and thank u for answering !​
    5·1 answer
  • <img src="https://tex.z-dn.net/?f=%5Cfrac%7B2x%5E%7B2%7D%20-50%7D%7Bx%5E%7B2%7D%20%2B7x%2B10%7D" id="TexFormula1" title="\frac{2
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!