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
Richard claims that the value of the expression 23x2+173x+12 is sometimes negative. Which of these values of x supports Richard'
Talja [164]
The correct answer is B.
6 0
2 years ago
Read 2 more answers
What is the equation of a line when the slope is -1/2 and the y-intercept is 0.
tangare [24]

Answer:

y = -1/2x + 0

y = mx+b

Step-by-step explanation:

8 0
3 years ago
The ratio of boys to girls is 5:3 there are 80 more boys than girls how many girls are there
shtirl [24]

Answer: 120

<u>Step-by-step explanation:</u>

              Ratio      Quantity

Boys:        5           80 + x                  

Girls:         3              x

                 \dfrac{5}{3}=\dfrac{80+x}{x}\\\\\\5x=3(80+x)\\\\5x=240+3x\\\\2x=240\\\\x=120

         

5 0
2 years ago
Can someone please help me out?
Lina20 [59]

sorry i dont get it eathier

6 0
3 years ago
Let f(x) = x ^ 2 - x - 2 and g(x) = - 6x - 8. Find g(2) and f(g(2)). Mathfrak g (2)= Box (Simplify your answer. ) f(g(2)) = ( Si
jek_recluse [69]

The value of the function f(g) after simplifying and putting 2 in place of <em>x</em> is -20 and the value of f(g(2)) is 418.

<h3>What is composite function?</h3>

When a function is written inside the another function, then such function is called the composite function.

The first function given in the problem is,

f(x) = x^2 - x - 2

The second function given,

g(x) = - 6x - 8

To find out the value of g(2), put the 2 on place of variable x in the above equation as,

g(2) = - 6(2) - 8\\g(2)=-12-8\\g(2)=-20

The composite function f(g(x)) can be given as,

f(g(2))= (-20)^2 - (-20) - 2\\f(g(2))=418

Thus, the value of the function f(g) after simplifying and putting 2 in place of <em>x</em> is -20 and the value of f(g(2)) is 418.

Learn more about the composite function here:

brainly.com/question/10687170

5 0
2 years ago
Other questions:
  • Amy is applying for a job in two companies. The given table shows the salary in dollars (y) that Company 1 is offering if she wo
    10·2 answers
  • Find the measure of each exterior angle of a regular<br> 15-gon.
    15·1 answer
  • You send 40 text messages in one month. The total cost is $4.80. How much does each text message cos
    7·2 answers
  • Suppose the probability of rain is 25%
    14·1 answer
  • Convert 56,000mm to meters
    9·1 answer
  • Gettalie has 4,246 pennies. She wants to trade them in four quarters.How many quarters will Helka receive for her pennies?
    15·1 answer
  • A plane takes off at 54 degrees latitude. It flies directly south and lands at -12 degrees latitude. Which expression represents
    13·1 answer
  • Need help with this Q&amp;A
    8·1 answer
  • For a lower tail hypothesis test with a sample size of 10 and a .10 level of significance, the critical value of the test statis
    5·1 answer
  • The circle below has a center D and its diameter is 10 feet. Given that m angle A D B equals 35 degree, find the length of major
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!