What is a sorting algorithm

Answers

Answer 1

Explanation:

In computer science, a sorting. algorithm is an algorithm that puts elements of a list in a certain order. The most frequently used orders are numerical order and lexicographical order. Efficient sorting is important for optimizing the efficiency of other algorithms that require input data to be in sorted lists

What Is A Sorting Algorithm

Related Questions

Write a Python program (rainfall.py) to collect data and calculate the average rainfall over a period of years. The program should first ask for the number of years. Then for each year, the program should ask twelve times, once for each month, for inches of rainfall for that month. At the end, , the program should display the number of months, the total inches of rainfall, and the average rainfall per month for the entire period.

Your program should contain two functions:

(1) rainfall(year): This function takes in a year (integer) as a parameter, and returns two values (totalMonths and totalRainfall). In this function, you need to use nested loop. The outer loop will iterate once for each year. The inner loop will iterate twelve times, once for each month. Each iteration of the inner loop will ask the user for inches (float) of rainfall for that month. After all iterations, the function should return the number of months (totalMonths) and the total inches of rainfall (totalRainfall). (Submit for 4 points)

(2) __main__: In the main, you do the following: (Submit for 6 points)

a. Prompt the user to input the number of years. Reprompt the user if the number of years is 0 or less. Hint: use a while loop.
b. Call rainfall(year) and pass to it the value entered above.
c. Calculate the average based on the returned values from rainfall function.
d. Display the number of months, the total inches of rainfall, and the average rainfall per month for the entire period.

Answers

Answer:

def rainfall(year):

   totalMonths = totalRainfall = 0

   for y in range(year):

       for month in range(12):

           rainfall = float(input(f"Enter inches of rainfall for month #{month+1}: "))

           totalRainfall += rainfall

   totalMonths = year * 12

   return totalMonths, totalRainfall

def __main__():

   while True:

       year = int(input("Enter the number of years: "))

       if year > 0:

           break

   numberOfMonths, totalRainfall = rainfall(year)

   averageRainFall = totalRainfall / numberOfMonths

   print(f"\nTotal number of months: {numberOfMonths}")

   print(f"The total inches of rainfall: {totalRainfall}")

   print(f"The average rainfall per month for the entire period: {averageRainFall}")

if __name__ == '__main__':

   __main__()

Explanation:

Create a function named rainfall that takes year as a parameter

Inside the function:

Create a nested for loop. The outer loop iterates for each year (The range is from 0 to year-1) and the inner loop iterates for each month of that year (The range is from 0 to 11). Inside the inner loop, ask the user to enter the rainfall for that month. Add the rainfall to the totalRainfall (cumulative sum)

When the loops are done, calculate the totalMonths, multiply year by 12

Return the totalMonths and totalRainfall

Inside the main:

Create a while loop that asks user to enter the number of years while it is greater than 0

Call the rainfall function, passing the year as parameter. Set the numberOfMonths and totalRainfall using the rainfall function

Calculate the averageRainFall, divide totalRainfall by numberOfMonths

Print the results

Computers were originally invented to
Group of answer choices
A.to share information on the Internet.

B.make complex mathematical calculations possible and make tasks easier for humans.

C.to play video games.

Answers

Answer:

B

Explanation:

It's B because why would it me made to play video games

Answer:

B

Explanation:

A, the internet didnt exist yet, so it cant be this

C, video games would require computers, so its ruled out on a similar basis as the previous

Assume in the for loop header, the range function has the three arguments: range (1, 10, 3), if you were to print out the value of the variable
in the for loop header, what will be printed out? List the values and separate them with a comma.

Answers

Answer:

1, 4, 7

Explanation:

The instruction in the question can be represented as:

for i in range(1,10,3):

   print i

What the above code does is that:

It starts printing the value of i from 1

Increment by 3

Then stop printing at 9 (i.e.. 10 - 1)

So: The sequence is as follows

Print 1

Add 3, to give 4

Print 4

Add 3, to give 7

Print 7

Add 3, to give 10 (10 > 10 - 1).

So, it stops execution.

In matlab how would this specific code be written and how could I ask the user to enter a vector of coefficients for the polynomial model. Verify that the entry has an even number of elements (an odd number of elements would mean an even order polynomial). If an invalid vector is entered, prompt the user to re-enter the vector until an acceptable vector is entered. If the user does not enter an acceptable vector after 5 attempts (including the first prompt), display a warning and remove the last element of the last vector entered. (For example, if the last user input is [1 2 3 4 5], the vector becomes [1 2 3 4]).
my code
[1,2,3,4];

Answers

Answer:

Explanation:

that is correct 1234

Where can the Field Service Manual containing Critical Callout, Disassembly and Reassembly instructions be found?

Answers

Answer:

Somewhere

Explanation:

9. Which of the following is the
leading use of computer?​

Answers

Complete Question:

What is the leading use of computers?

Group of answer choices.

a. web surfing.

b. email, texting, and social networking.

c. e-shopping.

d. word processing.

e. management of finances.

Answer:

b. email, texting, and social networking.

Explanation:

Communication can be defined as a process which typically involves the transfer of information from one person (sender) to another (recipient), through the use of semiotics, symbols and signs that are mutually understood by both parties. One of the most widely used communication channel or medium is an e-mail (electronic mail).

An e-mail is an acronym for electronic mail and it is a software application or program designed to let users send texts and multimedia messages over the internet.

Also, social media platforms (social network) serves as an effective communication channel for the dissemination of information in real-time from one person to another person within or in a different location. Both email and social networking involves texting and are mainly done on computer.

Hence, the leading use of computer is email, texting, and social networking.

define a computer, state its 3 main activities with examples of the functions of each of those activities​

Answers

Answer:

The four main functions of a computer are to:

- take data and instructions from a user

-process the data according to the instructions

- and display or store the processed data.

These functions are also referred as the input function, the procedure function, the output function, and the storage function.

Explanation:

When gathering the information needed to create a database, the attributes the database must contain to store all the information an organization needs for its activities are _______ requirements.

Answers

Answer:

Access and security requirements

Modify the following code so that:
Make the pool start with a random number ([20, 30] inclusive) of coins.
Based on the number of the randomly generated coins at the beginning,
let the computer determine whether Player 1 or Player 2 will be the
winner based on the winning strategy (by printing out the winner).
After deciding the supposed winner and loser, let the computer play
out both of the roles. For the winner, the computer should be applying
the winning strategy; for the loser, the computer should generate a
random amount of coins while following all the rules of the game
Rules of the game:
a) The game starts with 22 coins in a common pool
b) The goal of the game is to take the last coin
c) Two players take turns removing 1, 2, or 3 coins from the pool
d) A player can NOT take more coins than remaining coins in the pool
e) After each turn, the judge announces how many coins remain in the
pool
f) When the last coin is taken, the judge announces the winner
turn=0 #turn=1 remaining coins-24 print(Take turns removing 1, 2, or 3 coins. ) print(You win if you take the last coin.)

Answers

Answer:

Explanation:

The following code makes all the necessary changes so that the game runs as requested in the question. The only change that was not made was making the number of coins random since that contradicts the first rule of the game that states that the game starts with 22 coins.

turn = 0

remaining_coins = 22

print("Take turns removing 1, 2, or 3 coins. ")

print("You win if you take the last coin.")

while remaining_coins > 0:

   print("\nThere are", remaining_coins, "coins remaining.")

   if turn % 2 == 0:

       # Player1

       taken_coins = int(input("Player 1: How many coins do you take?"))

       turn += 1

   else:

       # Player2

       taken_coins = int(input("Player 2: How many coins do you take?"))

       turn += 1

   if taken_coins < 1 or taken_coins > 3 or taken_coins > remaining_coins:

       print("That's not a legal move. Try again. ")

       print("\nThere are", remaining_coins, "coins remaining.")

       if turn % 2 == 0:

           # Player1

           taken_coins = int(input("Player 1: How many coins do you take? "))

           turn += 1

       else:

           # Player2

           taken_coins = int(input("Player 2: How many coins do you take? "))

           turn += 1

       remaining_coins -= taken_coins

   else:

       remaining_coins -= taken_coins

   if remaining_coins - taken_coins == 0:

       print("No more coins left!")

       if turn % 2 == 0:

           print("Player 1 wins!")

           print("Player 2 loses !")

       else:

           print("Player 2 wins!")

           print("Player 1 loses!")

           remaining_coins = remaining_coins - taken_coins

   else:

       continue

The virus which activated on a specific data and time is called

Answers

Trojans and other computer viruses that activate on certain dates are often called "time bombs".

Question 2 (6 points)
The business philosophy describes the business's education, training, strengths, weaknesses, and personal development.
True
False
Question 3

Answers

Answer:

False

Explanation:

Answer:

false

Explanation:

1. How important is e-mail communication to you? Why?

Answers

Answer:

Communicating by email is almost instantaneous, which enhances communications by quickly disseminating information and providing fast response to customer inquiries. It also allows for quicker problem-solving and more streamlined business processes.

can someone write the answers pls :(?

Answers

Answer:

A:  job sharing.

B: part-time working.

C:  flexible hours.

D:  compressed hours.

A: Payroll workers, Typing pool workers, Car production workers, Checkout operators, Bank workers

B: Website designers, Computer programmers, Delivery drivers in retail stores, Computer maintenance staff, Robot maintenance staff.

3: Can lead to unhealthy eating due to dependency on ready meals, Can lead to laziness, Lack of fitness/exercise, Manual household skills are lost.

4: Microprocessor controlled devices do much of the housework, Do not need to do many things manually, Do not need to be in the house when food is cooking, Do not need to be in the house when clothes are being washed, Can leave their home to go shopping/work at any time of the day, Greater social interaction/more family time, More time to go out/more leisure time/more time to do other things/work, Are able to do other leisure activities when convenient to them, Can encourage a healthy lifestyle because of smart fridges analysing food constituents, Do not have to leave home to get fit

Explanation:

I tried really hard to solve these. I hope this answers your questions. can you make me the brainliest, that all I ask since I answered it for you. Pleasure solving these. C:

Pitch an idea for an app that would help with sustainability (examples could be recycling, food waste or energy). What features would it have, how would one of these features work and how would it positively impact the user of the app

Answers

you could do something like homeless help, it would be able to find homeless ppl if they signed up and get them a partner to help them with there life

Explanation:

A musician has recorded some initial ideas for new songs which she wishes to share with her bandmates. As these are initial ideas she is not too concerned about the quality of the audio files she will send, but does wish the size of the files to be as small as possible so they can be easily downloaded by her bandmates, including using mobile data. Which of the following should she do to meet these requirements? Select two answers.
Save the audio using a high sampling rate.
Save the audio using a low sampling rate.
Save the audio using a low bit depth.
Save the audio using a low amplitude (volume).

Answers

Answer:

1.save the audio using a low sampling rate

2.save the audio using a low bit depth

Explanation:

1. if the quality of the audio is low then the size of the audio will also be low and which will make the size of the data to be less and also easier to download

When text is used as a Hyperlink, it is usually underlined and appears as a different color.

Question 3 options:
True
False

Answers

True it usually shows up with a blue underline

what is the difference between the flip horizontal and the flip vertical option

Answers

Answer:

Flip horizontal: Flip around the vertical axis. Flip vertical: Flip around the horizontal axis.

Explanation:

hope this helps

Select the correct answer.
18. Which principle of animation involves presenting an object prominently as the focus of a scene?
A.
anticipation
B.
staging
C.
timing
D.
arcs
E.
ease in and ease out

Answers

Answer:

It's either B or D

Explanation:

If it's not I'm sorry :(

Arnie is planning an action shot and wants the camera to move smoothly alongside his running characters. He is working on a tight budget and can’t afford expensive equipment. What alternatives could you suggest?

Mount the camera on a wagon, wheelchair, or vehicle and move it next to the characters.
Rearrange your script so you don’t need to capture the motion in that way.
Try running next to the characters while keeping the camera balanced.
See if you can simulate the running with virtual reality.

Answers

Camera and wagon are answer

hy please help me do this​

Answers

Answer:

1 True

2 False

3 False

4 True

5 True

6 True

7 True

8 False

Explanation:

8 robot's are not perfect they make mistakes too

grade 11 essay about the year 2020​

Answers

Answer:

This 2020 have a new normal class because of CO VID-19 Disease have more students and teachers patient the teachers is preparing a module to her/his student and the student is answering are not learning lesson because of the COV ID-19 the whole word enduring to that pandemic and all fronliners is the hero in this pandemic because all frontliners is helping the people to we heal and to healed that virus.

Explanation:

6
Where is the Text Highlight Color button located?
a. In the Font group on the Home tab
b. In the Text group on the Edit tab
C. In the Paragraph group on the Home tab
d. In the Font group on the Edit tab

Answers

Answer C in the paragraph group on the home tab

For a company, intellectual property is _______________.


A) any idea that the company wants to keep secret


B) the same as the company’s policies


C) any topic discussed at a meeting of senior management


D) all of the company’s creative employees


E) a large part of the company’s value

Answers

Yea I think it is b but I’m not sure

For a company, intellectual property is any idea that the company wants to keep secret. Thus the correct option is A.

What is intellectual Property?

The type of integrity is defined as "intellectual property" which includes intangible works developed by humans with an innovative and problem-solving approach.

These intellectual properties are protected by companies to avoid leakage of the secret of development as well as to avoid imitation of the creation. This protection of the intellectual property is legally bounded.

If any violation of this act has been noticed and found guilty will have to face consequences in terms of charges of violation as well as heavy penalties based on the type and importance of the work.

Therefore, option A any idea that the company wants to keep secret is the appropriate answer.

Learn more about intellectual property, here:

https://brainly.com/question/18650136

#SPJ2

What is not a type of text format that will automatically be converted by Outlook into a hyperlink?
O email address
O web address
O UNC path
O All will be automatically converted.

Answers

Answer:

UNC path seems to be the answer

Answer:

UNC path

Explanation:

A resistor is found to have 3 A going through it with a voltage of 150 V. What is the resistance of the resistor?
10 points

Answers

Answer:

50 ohms

Explanation:

voltage = current * resistance, this is rearranged as

resistance = voltage / current, so if you plug in the numbers, you'll get

150/3,

resistance = 50 omhs

Which of the following activities do not involve Information Technology? *



A. Identification card theft

B.Dissemination of Information through social media

C. Listening to an mp3 device

D. Using a software to generate images​

Answers

Answer: B




hope it helps

If the maximum range of projectile is x. show that the maximum height reached by the same projectile is x/4.

Answers

Explanation:

Given that,

The maximum range of a projectile is x.

Maximum range occurs when the angle of projection is 45°. Using formula for maximum range.

[tex]R=\dfrac{v^2}{g}[/tex]

According to the question,

[tex]x=\dfrac{v^2}{g}[/tex] ...(1)

Maximum height,

[tex]h=\dfrac{v^2}{2g}[/tex]

From equation (1).

[tex]h=\dfrac{x}{2}[/tex]

Hence, this is the required solution.

With contention:_______.
a. computers wait until the circuit is free before they send data
b. the server or front end processor works consecutively through a list of clients to determine who should have access to the media
c. the front end processor must wait for a response from the polled client or terminal
d. one computer starts the poll and passes it to the next computer on the multipoint circuit
e. there is never a chance for collision, or two computers trying to send data at the same time

Answers

Answer:

a. computers wait until the circuit is free before they send data.

Explanation:

In Computer science, controlled access (X-ON/X-OFF) is typically the opposite of contention.

Controlled access is mainly used by computer networks that are being managed by a host mainframe computer system. X-ON is ready to receive while X-OFF isn't ready to receive.

With contention, computers wait until the circuit is free before they send data. It generally prevents collision between computer systems.

It must ask the user to input the tuition for this year. Suppose the tuition for a university is 10000$ this year and increases 5% every year. In one year, the tuition will be 10500$. Write a Java program that displays the tuition in 10 years, and the total cost of four years’ worth of tuition after the tenth years

Answers

Answer:

Answered below

Explanation:

//Program in Java

int percentIncrease = 0.05;

Scanner scan = new Scanner(System.in);

System.out.print("Enter tuition: ");

int tuition = scan.nextInt();

double tenYearIncrease = (percentIncrease * 10) * tuition;

double tenYearsTotal = tuition + tenYearIncrease;

//Tuition in ten years

System.out.print(tenYearsTotal);

//Total four years after

double newTuition = tenYearsTotal;

double fourYearsIncrease = (percentIncrease * 4) * newTuition;

double fourYearsTotal = newTuition + fourYearsIncrease;

System.out.print(fourYearsTotal);

In a word processing program, under which tab or menu option can you adjust the picture brightness?

Answers

Explanation:

You must have selected a picture in order the tab format to be available. you should click the picture then you want to change the brightness for and u under picture tools, on the format tab,in the adjust group, click corrections.
Other Questions
What is the significance of the design on the standard given to the princes? A. It represents the idea that the prosperity of India and Britain are interconnected. B. It signifies that India is a verdant country full of many different plants. C. It symbolizes the end of a long struggle between the two countries. D. It represents the British love of gardening. I need help with this asap! On a weather data map how can you tell where the temperature and air pressure measurements were taken? What is 2x + 8 & 4x - 4 ? Don't use a bot have actual proof please. Why did the chicken cross the road? and why did Santa went through the window instead the chimney?????? What can astronomical objects that have changing magnetic fields do 75.5 degrees East on the equator A collection of coins contains a total of sixteen dimes and quarters. It is worth $2.20 in all. How many dimes are in the collection? What is the answer to 6+6x=y define federal deposit insurance corporation. Write the equation of a line perpendicular to y= -x + 4 and that passes through point (-5,-4) in slope intercept form. Can someone help? Please? Blue flower is dominant to yellow flower. Tall plant is dominant to short. Cross BbTt * BbTt. What precenetage of the offsprings are expected to be heterozygous for both traits? thoughts about Debit vs Credit help please ???!!?! :)asap This histogram shows the number of shoppers in various age groups at a clothing store.How many shoppers are at least 20 years old?a. 7 shoppersb. 12 shoppersc. 13 shoppersd. 18 shoppers(IF ITS NOT CLEAR SWITCH PICRTURES)(PLEASE HELP) Explain the flexibility and the flow characteristics of water Identify the equation as either Linear, Quadratic, or Exponential: *f (x) = 2xA. LinearB. QuadraticC. Exponential Perform the indicated operation. (16 m2 + 40 m + 25) (4 m + 5) = _____ 5.solve for x 6. solve for x