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
Nikolay [14]
3 years ago
13

What is the f(n) runtime of the following pseudocode: sum-0 for A = N/2 downto 1 for B-1 t increment sum by B Explain: exactly w

hat is wrong with the following diagram why it is incorrect how to fix it NP NP- Complete
Computers and Technology
1 answer:
Romashka [77]3 years ago
3 0

The diagram part of the question is incomplete but the mathematical part has been solved below for you . However when the diagram will be attached it will be answered too.

Answer:

Following is the solution for the Time complexity/ Run Time:

Given that:

A = N/2 to 1

B = 1 to 4N

By summation:

Time Complexity = Lower bound of A * Upper Bound of B

Time Complexity = (N/2) * (4N)

By simplifying:

Time Complexity = N * 2N

Time Complexity = 2N^2

Hence the runtime f(n) for given pseudocode will be 2N^2

i hope it will help you!

You might be interested in
Which of the following is NOT a place where you are likely to encounter a pedestrian?
AlexFokin [52]

Answer:

A. On a highway

Explanation:

On a highway is NOT a place where you are likely to encounter a pedestrian.

Pedestrians found on highways usually get arrested or get a ticket.

3 0
3 years ago
Read 2 more answers
How to access Tor Browser on Android which is not rooted?
Mekhanik [1.2K]
An app you can look up on Google chrome called Aptoide has it on there for you to install.
7 0
3 years ago
What are the events?
erastovalidia [21]

Answer:

a thing that happens or takes place, especially one of importance.

8 0
3 years ago
Consider this data sequence: "3 11 5 5 5 2 4 6 6 7 3 -8". Any value that is the same as the immediately preceding value is consi
Darya [45]

// Variable to keep track of array size

int length = 0;

// Array itself

int array[] = {};

// while loop will take input in the array until a negative number is entered

while(input>=0){

stdin = new Scanner(System.in);

array[length] = stdin;

length +=1;

}

// int variable to terminate while loop

int i =0;

// keep track of index of output array

int y =0;

while(arr[i] != length){

// making output array

int output[]={}; bool flag;

// put the element in out put array considering if it the desired one

output[y] = array [i];

// Now check if it was the desired?

for(int z=1;z<=length;z++){

if(array[i+z]!=output[y]){

 flag = true;

}

else

{

 output[y]=0;

 y+=1;

}

if(array[i+z+1]=output[y] && flag == true){

output[y] = array[i];

y+=1;

}

}

//output the array

for(int o=0;o<y;o++)

System.out.println(output[o];

3 0
3 years ago
Is there anybody who knows eris quirk but me- i feel lonely rn ;-;
Nutka1998 [239]

Answer:i do Eri's Quirk allows her to rewind an individual's body to a previous state. She has shown the ability to rewind someone's body to a point before they existed, which she accidentally did to her father.

3 0
3 years ago
Read 2 more answers
Other questions:
  • The North American Free Trade Agreement (NAFTA) among Canada, Mexico, and the United States is intended to _____.
    5·2 answers
  • Is 37 words per minute when typing an okay grade?
    15·2 answers
  • What error, if any, is in the following code?
    11·1 answer
  • When numbers are changed in cells that are involved in formula is the formulas are automatically
    14·1 answer
  • Henrietta, the owner of a very successful hotel chain in the Southeast, is exploring the possibility of expanding the chain into
    15·1 answer
  • What do you understand by storage devices ? Name any two storage devices.​
    11·2 answers
  • Write an algorithm to sum to values
    11·1 answer
  • Vadik is creating a program where the user inputs their grade level and the program tells them which sports teams they are allow
    9·2 answers
  • Cathy designed a website for a cereal brand. When users view the website, their eyes first fall on the brand name, then they vie
    14·1 answer
  • When you start a new, blank document, you usually end up changing the font to arial 11. 5 point. How can you make these settings
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!