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
Yall please help meee
Lady_Fox [76]

Answer:

<u>12n + 2</u>

Step-by-step explanation:

w(n) = un + 2

w(3n) = 4(3n) + 2

ans = 12n + 2

hope it helps you

have a great day!!

6 0
3 years ago
NUMBER 41 FIND THE VALUE OF X
SVEN [57.7K]
The value of x is 4

Hope this helps
3 0
3 years ago
PLEASE HELP ASAP!!!!<br> Help soon please
meriva

Answer:

ok down below is the answer

Step-by-step explanation:

5+5+5+5+5+5+5 is 5x7

5x5x5x5x5x5x5 is 5 with a little 7

7x7x7x7x7 is 7 with a little 5

others are none :)

3 0
2 years ago
What is the answer to the problem 4y + 3 - y - 2
GaryK [48]

Answer:

3y+1

Step-by-step explanation:

4y+3-y-2

3y+3-2

3y+1

7 0
3 years ago
Read 2 more answers
Solve for a,b 2^a × 2^b=144 value of a+3b+2 is...<br><br>please solve it...urgent...​
Nadya [2.5K]

Answer:

its a simple for me

Step-by-step explanation:

2+144 i

4 0
3 years ago
Other questions:
  • Jill wrote the number 40. if her rule is add 7 what is the fourth number in jills pattern
    10·1 answer
  • When the perimeter of a rectangle is 68ft. and the ratio of it's length to it's width is9:8. What are the dimensions of the rect
    8·2 answers
  • Part 6
    15·1 answer
  • a baseball pitcher won 80% of the games he played. if he pitched 35 games, how many games did he win?
    6·2 answers
  • Pearl uses 9.8 pints of blue paint and white paint to paint her bedroom walls. 2 5 of this amount is blue paint, and the rest is
    6·1 answer
  • Which expressions represent the statement “three minus the product of seven and four”? Mark all that apply.
    10·1 answer
  • Someone please help me i really need it​
    13·1 answer
  • 11) Given: the function f defined by f(x) = 3x2 . Which statement is true?
    6·1 answer
  • What are the four quadrants for graphing ??????? <br><br><br> Plsssssssssssssss help me
    9·2 answers
  • Solve for x and round if necessary
    5·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!