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
Why do we need the Domain Name System (DNS)? Given the domain name www.flamingflamingos.eu, what is the top level domain in this
QveST [7]

Explanation:

We need the DNS(Domain Name System) because it connects to the webpage by using an Internet Protocol address and also used to convert the domain name into IP address on the internet.

Top-level domain is .eu

The top-level domain is also known as TLD, and it is the last part of the domain name.

There are 4 different nameservers.

It depends on the internet connection.

When we search for the valid IP address then it will connect us to that webpage whose IP address we search.

8 0
3 years ago
You use worksheets to perform calculations. How do you perform these calculations?
Elena-2011 [213]
The main function you will use is.... Type SUM= in all caps into a cell and then you can control click cells to add them together. You can also add PEMDAS properties to do calculations withing it.
5 0
3 years ago
Read 2 more answers
The Scientific Method is a/an
ser-zykov [4K]

Answer:

It's a method used in science to ask questions, research, observe, hypothesize, experiment, analyze data, and make conclusions.

Explanation:

5 0
3 years ago
Read 2 more answers
State the difference between a monitor and a television​
Maurinko [17]
The size of a monitor is not much larger. As these are used from a specific distance, it would be so inconvenient if a monitor size is too big.
7 0
2 years ago
Read 2 more answers
Explain how can you protect your computer from malware
rosijanka [135]
Trend micro security for your Mac or pc or trend micro mobil security for your android or iOS Mobil device?

Hope this helps!
6 0
3 years ago
Read 2 more answers
Other questions:
  • As you move the click and type pointer around the document, the icon changes to represent ____________________ that will be appl
    10·2 answers
  • Advances in television broadcasting have created changes in millions of U.S. families in a. ​sleep habits. b. ​conversation patt
    5·1 answer
  • I need to write a program that accepts eight int values representing student test scores from the user and then displays each of
    14·1 answer
  • Which part of the os provides users and applications with an interface to manipulate files?
    8·1 answer
  • Which of the following consists of electronic components that store instructions?
    10·1 answer
  • Que se puede observar en el escritorio de windows
    8·1 answer
  • Multiple Choice: We have been assigned the task of developing a software testing tool (tester) that can assess reachability of s
    11·1 answer
  • There are some games that cannot be described by a single--or even two-- genres. Can you think of any that should be invented?​
    6·1 answer
  • What type of hard disk is recommended for a Windows 10 VM?
    6·1 answer
  • What is System Testing
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!