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]
4 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]4 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
Help with math plssssss!
Olenka [21]

\dfrac{x\sqrt3}{\sqrt{4x}}=\dfrac{x\sqrt3}{\sqrt4\cdot\sqrt{x}}=\dfrac{x\sqrt3}{2\sqrt{x}}=\dfrac{x\sqrt3\cdot\sqrt{x}}{2\sqrt{x}\cdot\sqrt{x}}=\dfrac{x\sqrt{3x}}{2x}=\dfrac{\sqrt{3x}}{2}\to\boxed{4.}\\\\Used:\\\\\sqrt{ab}=\sqrt{a}\cdot\sqrt{b}\\\\\sqrt{a}\cdot\sqrt{a}=a

6 0
3 years ago
Helppp me plz Srry again
Kay [80]

Step-by-step explanation:

<em>I</em><em> </em><em>a</em><em>m</em><em> </em><em>r</em><em>e</em><em>a</em><em>l</em><em>l</em><em>y</em><em> </em><em>v</em><em>e</em><em>r</em><em>y</em><em> </em><em>s</em><em>o</em><em>r</em><em>r</em><em>y</em><em> </em><em>a</em><em>b</em><em>o</em><em>u</em><em>t</em><em> </em><em>t</em><em>h</em><em>i</em><em>s</em><em> </em><em>b</em><em>e</em><em>c</em><em>a</em><em>u</em><em>s</em><em>e</em><em> </em><em>I</em><em> </em><em>c</em><em>a</em><em>n</em><em>'</em><em>t</em><em> </em><em>a</em><em>n</em><em>s</em><em>w</em><em>e</em><em>r</em><em> </em><em>o</em><em>f</em><em> </em><em>t</em><em>h</em><em>i</em><em>s</em><em> </em><em>q</em><em>u</em><em>e</em><em>s</em><em>t</em><em>i</em><em>o</em><em>n</em><em> </em><em>b</em><em>e</em><em>c</em><em>a</em><em>u</em><em>s</em><em>e</em><em> </em><em>I</em><em> </em><em>c</em><em>a</em><em>n</em><em>'</em><em>t</em><em> </em><em>u</em><em>n</em><em>d</em><em>e</em><em>r</em><em>s</em><em>t</em><em>a</em><em>n</em><em>d</em><em> </em><em>I</em><em> </em><em>a</em><em>m</em><em> </em><em>s</em><em>o</em><em>o</em><em>o</em><em>o</em><em>o</em><em> </em><em>s</em><em>o</em><em>r</em><em>r</em><em>y</em>

4 0
3 years ago
Dave receives a salary of $200 a week plus a commission of 10% of his weekly sales. An equation y=mx+b represents Dave’s weekly
eduard
<span><u><em>Answer:</em></u>
Dave makes $350 

<u><em>Explanation:</em></u>
In order to find this answer, we must first establish the equation for his earnings.
<u>We use slope intercept form:</u>
 y = mx + b,
where m = slope and b = y-intercept.

Since the problem states that his commission percentage is the slope and his base salary is the y-intercept, we can use them in the equation <u>to get the following: </u>
y = 0.1x + 200.

Now knowing that the x is the amount he sells, we can use the $1500 as x to find his total pay for the week:.
y = 0.1(1500) + 200,
y = 150 + 200,
y = 350. </span>
6 0
3 years ago
Read 2 more answers
Solve the system of linear equations using elimination.
N76 [4]

Answer:

C (-2,1)

Step-by-step explanation:

−2x − y = 3 (1)

−9x − y = 17 (2)

(1) y = -2x - 3

(2) y = -9x - 17

-2x - 3 = -9x - 17

7x = -14

x = -2

y = -2(-2) - 3

y = 4 - 3

y = 1

8 0
4 years ago
Which point on the graph tells you the number of pies you could make with 3/4 cup of sugar? A-(4,3) B-(1, 3/4) C-(8,6) D-(0,0)
lawyer [7]

Answer:

I think the answer is B(3,4).

Step-by-step explanation:

It is that answer because that answer is the only one that stops with and x factor and a y factor.

5 0
3 years ago
Other questions:
  • Helpppppppppppppppp pleaseeeeeeeeeeeee<br> Factor. 9x^2+27x+45
    9·2 answers
  • The graph of f(x) = x2 is shifted 3 units to the left to obtain the graph of g(x). Which of the following equations best describ
    13·2 answers
  • WILL GIVE BRAINLIEST Which expression represents the volume, in cubic units, of the composite figure?
    6·1 answer
  • What is the slope of the perpendicular lines?
    5·1 answer
  • Amelia and Elliott are collecting empty soda cans for recycling. Amelia has 13 less than 5 times the cans that Elliott has. Toge
    8·1 answer
  • In a certain​ chemical, the ratio of zinc to copper is 3 to 11. A jar of the chemical contains 264 grams of copper. How many gra
    12·2 answers
  • Rohan buys 1 dozen pens for 180 and Saurav buys 7 pens for 390. Who bought costlier pens ​
    11·2 answers
  • What is the equation of the line through (-6,-5) and (-4,-4) in slope -intercept form?
    14·1 answer
  • 1. Order each set of numbers from least to greatest.
    13·1 answer
  • In Triangle 2, b=10 in, a=14 in, and theta=65 degrees solve for c, a, and B.
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!