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
If 7(3x+9) and 21x + T are equivalent, what is the value of T?
bearhunter [10]

Answer:

63

Step-by-step explanation:

Because 7(9)=63.

3 0
3 years ago
I NEED HELP IM LATE PLEASE
Inga [223]

Answer:

9x, 8x+12

Step-by-step explanation:

x(2x+7)-2x(x-1)

=> 9x

3 0
3 years ago
Find the average rate of change, in simplest form,<br> of the function over the interval 3 ≤ x ≤ 5
gavmur [86]
The answer to your question that you’re trying to figure out is [3,5]
3 0
2 years ago
Find the volume of the composite figure. please!
Irina-Kira [14]
Volume= Length * width ( aka Base ) * height 

Break up the figure into easier figures, a small square and a bigger square.

Small square- 3*2*1 = 6 cm

Large Square- 7*6*1 = 42 cm

42 + 6 = 48 cm. But wait! You have to take one more step, which is minus-ing 6 from 48. Why? Notice that there is a little area where a side of the small square meets the bigger square. That little area is worth 3 cm ( length is 3, height is 1 cm ) times 2 ( 3 cm is one side, another 3 cm is the other side from the other square ) = 6 cm.

Your total answer should be 42. ( or 48, if your teacher doesn't count the area where the squares meet/join together ).

3 0
3 years ago
Read 2 more answers
Of the numbers 8, 9, or 10 which is a solution of the inequality n - 3 &gt; 6
leva [86]

Answer:

10, because 10-3 is 7, and 7 is greater than 6.

3 0
3 years ago
Read 2 more answers
Other questions:
  • 9 grams = how many milligrams
    8·1 answer
  • Explain how to find the simplest form of 100/1000
    15·2 answers
  • What is a repeating decimal between -2 1/3 and -2 1/5.
    11·1 answer
  • Which of the following is an arithmetic sequence​
    8·1 answer
  • Evie sent 63 texts over a 3-day span of time. What was the rate of texts Evie sent per day?
    8·1 answer
  • If the triangle on the grid below is translated by using the rule (x, y) right-arrow (x minus 2, y + 2), what will be the coordi
    15·2 answers
  • Help please some one
    7·1 answer
  • Pls help Will give brainiest
    13·1 answer
  • 1)4(x– 12) + 19 = -89<br> 2)7+5(x-2)=12<br> 3)-4x-2(2x+10)=-116<br> 4)2(x+9)-4=68
    12·1 answer
  • Pls help im in dire need cause bainly doesnt got this yet
    15·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!