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
Ivahew [28]
3 years ago
12

Write a program to solve the selection problem. Let k = N/2. Draw a table showing the running time of your program for various v

alues of N.
Computers and Technology
1 answer:
Brums [2.3K]3 years ago
4 0
So here is the code in Python:

n = 0.00 #this is a float because there are some numbers that are decimals.

while n < 20: #n which is 0.00 and while it is lower than 20 if runs the code below
n = n + 1 #it will add 1 to n everything it runs the code.
k = n / 2 #it will divide whatever n is everytime by 2
print(str(n) + '/2: ') # it's printing the number it's on
print(k) # prints the answer for the n.

You can change n to add by any, make n any num instead of 0.00 and you can change the while condition from n < 20 to any other logical statement. If you want to get creative you can take 2 inputs for numbers and make one of them the starting number and other one is the ending number. Also make sure to make n a number lower than you starting point because if you set n as your starting point then it will skip it.

You might be interested in
nder a Huffman encoding ofnsymbols with frequenciesf1, f2, . . . , fn, what is the longest a codewordcould possibly be
Natasha2012 [34]

Answer:

The longest codeword that could possibly be for "n" symbol is n-1 bits.

Explanation:

From the given information:

Suppose we are to consider a set of frequencies \mathtt{f_1,f_2,f_3 ...,f_n}, for which f is a symbol for the length n. Therefore, the longest codeword that could possibly be for "n" symbol is n-1 bits.

However, during the encoding for "n" in conjunction with n-2, then the possibilities for n are; \mathtt{\dfrac{1}{2}, \dfrac{1}{4}, ... \dfrac{1}{2^{n-2}}}

We can conclude that the longest codeword that could possibly be for "n" symbol is n-1 bits.

5 0
3 years ago
Given that a function receives three parameters a, b, c, of type double , write some code, to be included as part of the functio
hoa [83]

Answer:

   public static void quad(double a, double b, double c) {

       double D = (Math.pow(b, 2)) - (4 * a * c);

       if (D<0){

           System.out.println("no real solutions");

       }

   }

Explanation:

The code snippet above implements the function in Java programming language

As required by the question, the line  double D = (Math.pow(b, 2)) - (4 * a * c); evaluates b squared" - 4ac and assignes the value to the variable D

An if statement is used to test if D is less than 0, if this is true the message no real solutions is printed

5 0
3 years ago
Help guys thank you =) ​
MrRissso [65]
1.LR
2.LR
3.HR
4.LR
5.HR
6 0
2 years ago
You are adding more features to a linear regression model and hope they will improve your model. If you add an important feature
Ludmilka [50]

Answer:

The answer is "Option A".

Explanation:

Add extra functionality, otherwise, it increases the R-square value, which is defined in the following points:      

  • To incorporate essential elements, R-square is explicitly promoted.
  • It Increases the R-square value, which is an additional feature.
  • It removes the features, which provide the value of the reduce R-square.
  • After incorporating the additional features is used as the model, which is R-square, which is never reduced.
8 0
2 years ago
Suppose you’re creating a slide presentation. During the presentation, you’ll need to go to a specific address on the Web. You s
Lesechka [4]

hyperlink

a hyperlink is what will let them click the link and go to it

please give branlest

3 0
3 years ago
Read 2 more answers
Other questions:
  • Abigail is interested in connecting her tablet that usually connects to a wireless network, to her personal computer that usuall
    11·2 answers
  • What is the most efficient way to include a space after each paragraph?
    13·2 answers
  • How can I sent a message?
    13·1 answer
  • A star appears under the <br> menu of the word processing program.
    5·1 answer
  • the microsoft excel application is a _____ program. database word-processing spreadsheet desktop-publishing
    8·1 answer
  • You are part of a team that is setting up a movie streaming service. The company is planning on initially making available 500 m
    8·1 answer
  • What is the disadvantages of using proprietary software
    10·2 answers
  • What term describes what an actor breaks when he addresses the audience directly from stage, like in Hamlet’s “to be or not to b
    13·2 answers
  • The goal of a system is to
    6·1 answer
  • 9. Themes can be modified using variants. *<br><br>True<br>False​
    7·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!