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
Find the slope of the line with the given equation. Show your work.<br> 6x – 2y = 18
Vera_Pavlovna [14]
Currently the equation 6x - 2y = 18 is in standard form. Convert the standard form equation into a slope-intercept form and we can find the slope easily.

Solve for y.

6x - 2y = 18
-2y        = 18 - 6x <-- Subtract 6x from each side. This is to isolate the 2y term
2y / -2  = \frac{18 - 6x}{2} <-- Divide each side by 2. This it to
                                                               get rid of the 2 coefficient.
y = -9 + 3x

Rearrange the right-hand side a bit.

y = -9 + 3x becomes y = 3x - 9

Now it is in slope-intercept form.
The slope is the coefficient of the x variable.

So, 3 is the slope.
7 0
3 years ago
What is an equation of the line that passes through the points (-3,1) and (-4,0)
kicyunya [14]

Answer:

y = x + 4

Step-by-step explanation:

  1. The slope = (1 - 0)/(-3-(-4)) =1
  2. 1 = -3 + x, x =4
  3. So, y = x + 4
5 0
1 year ago
Read 2 more answers
Kelly is knitting a scarf for her brother. It took her 2/3 hour to knit 5/6 foot of the scarf. How fast is Kelly's knitting spee
juin [17]

Answer:

C. 4/5 feet per hour

Step-by-step explanation:

All you wanna do is to divide 2/3 and 5/6

then you'll have 4/5

Hoped this helps!

4 0
2 years ago
Whats the variable of 1
Fudgin [204]

Answer:

There are no variables, there is only a 1

Step-by-step explanation:

7 0
2 years ago
What are the solutions of the quadratic equation 4x2 - 8x – 12 = 0?
Juliette [100K]

Answer:

see bottom

Step-by-step explanation:

divide through by 4

x2 - 2x - 3 = 0

x2 - 3x + x - 3 = 0

(x2 - 3x) + (x - 3) = 0

x(x - 3) + 1(x - 3) = 0

(x + 1) (x - 3) = 0

x + 1 = 0 and x - 3 = 0

x = -1 and x = 3

5 0
3 years ago
Other questions:
  • Please help asap 32 pts
    5·1 answer
  • 280 is what percent of 400?
    6·2 answers
  • Please help ASAP Very URGENT Need help Due Tomorrow Need your help PLEASE ANYONE PLEASE COME AND HELP
    7·1 answer
  • HELP ME PLEASE!!!!! ASAP
    15·2 answers
  • The revenue each season from tickets at the theme part is represented by t(x) = 3x. The cost to pay the employees each season is
    9·2 answers
  • Mary work at Wal-Mart and earns $11.25 per hour. At the end of the week she had worked 35 hours. How much did she earn that week
    11·1 answer
  • Factorise:
    14·1 answer
  • Helpppppppp please helppppp I’ll give Brainliest
    10·1 answer
  • Please help me with this
    10·1 answer
  • Warm-Up
    15·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!