answer.
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
NeX [460]
2 years ago
11

Write the state of the elements of each of the following arrays after each pass of the outermost loop of the selection sort algo

rithm has occurred (after each element is selected and moved into place). int[] numbers3 = {8, 5, –9, 14, 0, –1, –7, 3}; int[] numbers4 = {15, 56, 24, 5, 39, –4, 27, 10};
Computers and Technology
1 answer:
My name is Ann [436]2 years ago
4 0

Answer:

The following are the explanation given below.

Explanation:

In the first case => 8, 5, –9, 14, 0, –1, –7, 3.

  • 8, 5, –9, 14, 0, –1, –7, 3 For the first instance, search for the smaller form 1st to 8th as well as move 3rd in the first one.
  • -9, 8, 5, 14, 0, –1, –7, 3 For the second instance, search for the smaller in the second to the 8th and move the last second in the second one.
  • -9, –7, 8, 5, 14, 0, –1, 3 For the third instance, search for the smallest in the third to the 8th and move the last second from the third one.
  • -9, –7, –1, 8, 5, 14, 0, 3 For the fourth instance, search for the smallest in the fourth to the 8th and move the last second from the fourth one.
  • -9, –7, –1, 0, 8, 5, 14, 3 For the fifth instance, search for the smallest in the fifth to the 8th and move the last from the fifth one.
  • -9, –7, –1, 0, 3, 8, 5, 14 For the sixth instance, search for the smallest in the sixth to the 8th and move the last second from the sixth one.
  • -9, –7, –1, 0, 3, 5, 8, 14 are sorted.

In the second case => 15, 56, 24, 5, 39, –4, 27, 10.

  • 15, 56, 24, 5, 39, –4, 27, 10 For the first instance, search for the smaller form 1st to 8th as well as move last 3rd from the first one.
  • -4, 15, 56, 24, 5, 39, 27, 10 For the second instance, search for the smaller in the second to the 8th and move the last fourth in the second one.
  • -4, 5, 15, 56, 24, 39, 27, 10 For the third instance, search for the smallest in the third to the 8th and move the last from the third one.
  • -4, 5, 10, 15, 56, 24, 39, 27 For the fourth instance, search for the smallest in the fourth to the 8th and not move that instance it already sorted.
  • -4, 5, 10, 15, 56, 24, 39, 27 For the fifth instance, search for the smallest in the fifth to the 8th and move the last third from the fifth one.
  • -4, 5, 10, 15, 24, 56, 39, 27 For the sixth instance, search for the smallest in the sixth to the 8th and move the last from the sixth one.
  • -4, 5, 10, 15, 24, 27, 56, 39 For the seventh instance, search for the smallest in the seventh to the 8th and move the last from the seventh one.
  • -4, 5, 10, 15, 24, 27, 39, 56 are sorted.
You might be interested in
What does the binary odometer show about representing large numbers​
Gelneren [198K]

Answer and Explanation:

The binary odometer represents the large number to judge that what happened when there is a large number that gets too large

Here we visit the level 2 of the binary odometer widget in the chapter of Code studio

This represents a widget that reproduced an odometer of a car in which the tracking of a device could be known that how much far the car is driven with respect to the miles or kilometers

7 0
2 years ago
George and Miguel are considering opening up a shoe store but first need to do market research. Which one of these is NOT part o
Morgarella [4.7K]
The correct answer is D, Draw conclusions and make decisions for their business based on the research results.
7 0
2 years ago
Read 2 more answers
Write a program named edit_data.py that asks a person their age. Accept an int. Use a custom exception to return a message if th
Katena32 [7]
An exception is an error that happens during the execution of a program. Exceptions are known to non-programmers as instances that do not conform to a general rule. The name "exception" in computer science has this meaning as well: It implies that the problem (the exception) doesn't occur frequently, i.e. the exception is the "exception to the rule". Exception handling is a construct in some programming languages to handle or deal with errors automatically. Many programming languages like C++, Objective-C, PHP, Java, Ruby, Python, and many others have built-in support for exception handling.

Error handling is generally resolved by saving the state of execution at the moment the error occurred and interrupting the normal flow of the program to execute a special function or piece of code, which is known as the exception handler. Depending on the kind of error ("division by zero", "file open error" and so on) which had occurred, the error handler can "fix" the problem and the programm can be continued afterwards with the previously saved data.
5 0
2 years ago
RADIAC instruments that operate on the ionization principle are broken down into three main categories based on what?
mash [69]

Answer:

Electrical potential.

Explanation:

RADIAC Meter or instruments ( also known as radiation monitoring instruments) are measuring instruments that uses the principles of gaseous ionisation to conduct electricity flow internally to deflect the pointer for its Meter readings. These instruments can be analogue or digital.

They are used in industries to monitor the operation of certain equipments and processes. The level of electrical potential flow in the system determines the state or category of the instrument. Out of six, there are three main categories of electrical potential level.

6 0
2 years ago
The hostel in which you plan to spend the night tonight offers very interesting rates, as long as you do not arrive too late. Ho
faust18 [17]

Answer:

Answered below

Explanation:

// Python implementation

incrementAmount = 5

basePrice = 10

price = 0

arrivalHour = int(input("Enter arrival hour 0-12: ")

if arrivalHour < 0 or arrivalHour > 12:

print ("Invalid hour")

if arrivalHour == 0:

price = basePrice

else:

price = arrivalHour * incrementAmount

totalPrice = price + basePrice

if totalPrice > 53:

totalPrice = 53

print ("Your bill is $totalPrice")

4 0
2 years ago
Other questions:
  • Icon view, list view, and details view are all common views provided by which kind of program?
    6·2 answers
  • Which type of address is used at the transport layer to identify the receiving application?
    14·1 answer
  • Assume there is a class AirConditioner that supports the following behaviors: turning the air conditioner on and off. The follow
    7·1 answer
  • Flight Simulation software, which imitates the experience of flying, is often used to train airline pilots. Which of the followi
    10·2 answers
  • Create a procedure named FindLargest that receives two parameters: a pointer to a signed doubleword array, and a count of the ar
    13·1 answer
  • 1. (1 point) Which flag is set when the result of an unsigned arithmetic operation is too large to fit into the destination? 2.
    13·1 answer
  • Suppose that a class named ClassA contains a private nonstatic integer named b, a public nonstatic integer named c, and a public
    14·1 answer
  • **Click the photo** Put the steps in order to produce the output shown below. Assume the indenting will be correct in the progra
    9·1 answer
  • Assign total_owls with the sum of num_owls_A and num_owls_B.
    11·1 answer
  • 1.erros can easily be ____ 2.work is done in an ____ no mess environment 3.colors do not _____ and brushes are never ______ 4.st
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!