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
Whose task it is to ensure that the product flows logically from one step to another?
vlabodo [156]

Answer:

The broad responsibility of a UX designer is to ensure that the product logically flows from one step to the next. One way that a UX designer might do this is by conducting in-person user tests to observe one’s behavior.

Explanation: I don't know if this is what your looking for though.

3 0
3 years ago
(1) prompt the user for a string that contains two strings separated by a comma. (1 pt) examples of strings that can be accepted
GalinKa [24]

package parsestrings;

import java.util.Scanner;

public class ParseStrings {

public static void main(String[] args) {

Scanner scnr = new Scanner(System.in); // Input stream for standard input

Scanner inSS = null; // Input string stream

String lineString = ""; // Holds line of text

String firstWord = ""; // First name

String secondWord = ""; // Last name

boolean inputDone = false; // Flag to indicate next iteration

// Prompt user for input

System.out.println("Enter input string: ");

// Grab data as long as "Exit" is not entered

while (!inputDone) {

// Entire line into lineString

lineString = scnr.nextLine()

// Create new input string stream

inSS = new Scanner(lineString);

// Now process the line

firstWord = inSS.next();

// Output parsed values

if (firstWord.equals("q")) {

System.out.println("Exiting.");

inputDone = true;

if (firstWord.matches("[a-zA-Z]+,[a-zA-Z]+")) {

System.out.print("Input not two comma separated words");

}

} else {

secondWord = inSS.next();

System.out.println("First word: " + firstWord);

System.out.println("Second word: " + secondWord);

System.out.println();

}

}

return;

}

}

5 0
3 years ago
The waterfall model and spiral model are variations of SDLC. Do some research to find out what they are and explain how these mo
Radda [10]

Waterfall model and spiral model are used in software development life cycle or SDLC. Any software development process follows one of these models depending on the type of software and the requirements of the customer.

Waterfall model

This model is called as sequential model since it works in stages. The output of first stage becomes the input of the second stage.

The errors of the first stage can be rectified only when it is completed. This is time consuming and makes the process lengthy. Stage 1 is completed before stage 2 begins.

The six stages involved in waterfall model are Requirement Gathering and analysis, System Design, Implementation, Integration and Testing, Deployment of system, and Maintenance.

Spiral model

This model is implemented in iterations. It is also called evolutionary model.  

Initially a prototype of the system is prepared. Then, it is followed by development of small parts of the system.

These smaller parts are then assembled to produce the final system.

The four stages which form the spiral model are Identification, Design, Development and Evaluation and Risk Analysis.

The differences between the two models are summarized below.

1. Waterfall model works in linear method. Spiral model follows evolutionary method.

2. Errors and risks are discovered/ rectified after the stage is over. Errors and risks are discovered/ rectified earlier.

3. Waterfall model is suitable for small projects. Spiral model is suitable for large projects.

4. Requirements identification and planning is the initial stage in the waterfall model. Requirements identification and planning is done when needed, in the spiral model.

5. Waterfall model allows little to no flexibility in the system. Spiral model allows flexibility in the system.

6. Low flexibility makes the waterfall model more risky. High flexibility makes the spiral model less risky.

7. Waterfall model, overall, takes less time since requirements are clear. Spiral model is implemented when the requirements of the system are not clear and become clear through prototypes.

8 0
3 years ago
To create a formula in______, you would first click in one of the cells​
Pavlova-9 [17]

Answer:excel

Explanation:

5 0
3 years ago
Read 2 more answers
A piece of glass has a thin film of gasoline floating on it. A beam of light is shining perpendicular on the film. If the wavele
kobusy [5.1K]

Answer:

200 nm

Explanation:

We need a constructive interference to see the bright reflection

we know that 2t=m\lambda  where m=1 and \lambda is the wavelength of the gasoline

so \lambda =\frac{560}{1.4}=400nm

putting the value of m and \lambda in thickness equation

t=\frac{1\times 400}{2}=200nm

so the thickness of the film will be 200 nm

3 0
3 years ago
Other questions:
  • Opinions are always based on facts. <br> a. True<br> b. False
    7·2 answers
  • Consider the recursive method myprint in this code snippet: public void myprint(int n) { if (n &lt; 10) { system.out.print(n); }
    5·1 answer
  • What are the data types used in C programming with examples
    5·1 answer
  • Give an example of a language L such that |L|=5 and |L^2|=16.
    5·1 answer
  • (1) Prompt the user to enter two words and a number, storing each into separate variables. Then, output those three values on a
    5·1 answer
  • Is the jane austen pride and prejudie a primary source
    6·1 answer
  • It keeps saying “something is going wrong oops!” when i click on my brainly notifications what do I do
    9·1 answer
  • What is the difference between web and internet ?
    10·1 answer
  • Complete the sentence.<br> A ___ number is composed of only zeros and ones.
    8·1 answer
  • A serial schedule:
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!