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
I dont need any work just the answer for both worth 300 points
Jobisdone [24]
A for #1
C for #2 ! Hope this helped you out!
4 0
3 years ago
Read 2 more answers
QUICK HELP ILL GIVE BRAINLIEST
Zigmanuir [339]

Answer:

When I first saw you... and you act like a baka..

Step-by-step explanation:

6 0
2 years ago
Read 2 more answers
Select all the expressions that are equivalent to the polynomial below.
katrin2010 [14]
The answers are: D and C and A and E
because: 


B 3(x - 5) - 2(6x2 + 9x + 5)=<span><span><span>−<span>12<span>x^2</span></span></span>−<span>15x</span></span>−<span>25

</span></span>F (4x2 - 13x - 7) - (16x2 + 9x - 5)=<span><span>−<span>12<span>x2</span></span></span>−<span>22x</span></span>−<span>2

E </span>(-15x2 + 9x - 10) + (3x2 - 10x - 5)=<span><span>−<span>12<span>x^2</span></span></span>−x</span>−<span>15</span>
4 0
3 years ago
Read 2 more answers
HELP ME PLEASE!!! THANK YOU!
AURORKA [14]

Answer:

down v

Step-by-step explanation:

1=20 mph

2=40 mph

3 1/4= 60.5 mph(im not sure if its correct but.)

.5 mph=10

2.5 mph=50

thats all i know

3 0
2 years ago
In 45 years, Gabriel will be 4 times as old as she is right now
kompoz [17]

Answer:

he just might be

Step-by-step explanation:

7 0
2 years ago
Read 2 more answers
Other questions:
  • NEED HELP ASAP! SPAM WILL BE DELETED!
    10·1 answer
  • Solve using the quadratic formula...<br> 9x2 - 4 + 7x
    10·2 answers
  • Help please!!! Anyone who can do math I can pay you if you dm me
    12·1 answer
  • You draw 2 cards from a deck. What’s the probability that one is red and the other is black
    8·1 answer
  • An internet search engine looks for a keyword in 9 databases, searching them in a random
    14·1 answer
  • A publisher reports that 49I% of their readers own a personal computer. A marketing executive wants to test the claim that the p
    13·1 answer
  • What is 7,000 written in word from
    9·2 answers
  • Jovie's boss tells her to make 6
    14·1 answer
  • Which of the following are true statements using the Associative Property of Multiplication?
    11·2 answers
  • runners in a marathon are randomly assigned to one of ten corrals to start, and each given a green, blue, or red shirt to wear.​
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!