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
Andrej [43]
3 years ago
15

In details and step-by-step, show how you apply the Bubble Sort algorithm on the following list of values. Your answer should sh

ow all inner and outer loops entries in each pass of the sort algorithm (i.e. list all 5 numbers in pass one, then list all 5 numbers in pass two, then list all 5 numbers in pass three… etc.)19, 18, 25, 17, 12
Engineering
1 answer:
astraxan [27]3 years ago
6 0

( 12 17 18 19 25 )

<u>Explanation:</u>

<u>First Pass:</u>

( 19 18 25 17 12 ) –> ( 18 19 25 17 12 ), Here, algorithm compares the first two elements, and swaps since 19 > 18.

( 18 19 25 17 12 ) –> ( 18 19 25 17 12 ), Now, since these elements are already in order (25 > 19), algorithm does not swap them.

( 18 19 25 17 12 ) –> ( 18 19 17 25 12 ), Swap since 25 > 17

( 18 19 17 25 12 ) –> ( 18 19 17 12 25 ), Swap since 25 > 12

<u>Second Pass:</u>

( 18 19 17 12 25 ) –> ( 18 19 17 12 25 )

( 18 19 17 12 25 ) –> ( 18 17 19 12 25 ), Swap since 19 > 17

( 18 17 19 12 25 ) –> ( 18 17 12 19 25 ), Swap since 19 > 12

( 18 17 12 19 25 ) –> ( 18 17 12 19 25 )

<u>Third Pass:</u>

( 18 17 12 19 25 ) –> ( 17 18 12 19 25 ), Swap since 18 > 17

( 17 18 12 19 25 ) –> ( 17 12 18 19 25 ), Swap since 18 > 12

( 17 12 18 19 25 ) –> ( 17 12 18 19 25 )

( 17 12 18 19 25 ) –> ( 17 12 18 19 25 )

<u>Fourth Pass:</u>

( 17 12 18 19 25 ) –> ( 12 17 18 19 25 ), Swap since 17 > 12

( 12 17 18 19 25 ) –> ( 12 17 18 19 25 ), Swap since 18 > 12

( 12 17 18 19 25 ) –> ( 12 17 18 19 25 )

( 12 17 18 19 25 ) –> ( 12 17 18 19 25 )

Now, the array is already sorted, but our algorithm does not know if it is completed. The algorithm needs one whole pass without any swap to know it is sorted.

<u>Fifth Pass:</u>

( 12 17 18 19 25 ) –> ( 12 17 18 19 25 )

( 12 17 18 19 25 ) –> ( 12 17 18 19 25 )

( 12 17 18 19 25 ) –> ( 12 17 18 19 25 )

( 12 17 18 19 25 ) –> ( 12 17 18 19 25 )

You might be interested in
Oliver is designing a new children’s slide to increase the speed at which a child can descend. His first design involved steel b
AVprozaik [17]

Answer:

The correct option is;

A) Steel becomes too hot in the Sun and can burn the children

Explanation:

The properties of steel includes;

Low specific heat capacity, high thermal and electrical toughness, high hardness, high tensile strength, high yield strength, appreciable elongation, high fatigue strength, can easily corrode, high malleability and ability to creep

Therefore, due to the low specific heat capacity, which is 0.511 J/(g·°C) and high conductivity of steel which is about 32 W/(m·k), the temperature of the steel can rapidly rise and the hot steel surface can readily conduct the heat, (due to the temperature difference) to other bodies that come in contact

8 0
3 years ago
Yield and tensile strengths and modulus of elasticity . with increasing temperature. (increase/decrease/independent)
meriva

Answer:

Yield strength, tensile strength decreases with increasing temperature and modulus of elasticity decreases with increasing in temperature.

Explanation:

The modulus of elasticity of a material is theoretically a function of the shape of curve plotted between the potential energy stored in the material as it is loaded versus the inter atomic distance in the material. The temperature distrots the molecular structure of the metal and hence it has an effect on the modulus of elasticity of a material.

Mathematically we can write,

E(t)=E_o[1-a\frac{T}{T_m}]

where,

E(t) is the modulus of elasticity at any temperature 'T'

E_o is the modulus of elasticity at absolute zero.

T_{m} is the mean melting point of the material

Hence we can see that with increasing temperature modulus of elasticity decreases.

In the case of yield strength and the tensile strength as we know that heating causes softening of a material thus we can physically conclude that in general the strength of the material decreases at elevated temperatures.

6 0
3 years ago
What are the nine Historical periods?
Rufina [12.5K]

Answer:

https://quizlet.com/148993376/the-nine-distinct-periods-of-time-flash-cards/

Explanation:

you can find them all : )

7 0
3 years ago
Which of the following is NOT associated with Urban Sprawl?
pochemuha

The option that is not associated with the given term called urban sprawl is; Option A: Blocking high views

What is Urban Sprawl?

Urban sprawl is defined as the rapid expansion of the geographic boundaries of towns and cities which is often accompanied by low-density residential housing and increased reliance on the private automobilefor movement.

Looking at the given options, "blocking high views" is the option that is not typically a problem associated with urban sprawl because urbanization usually takes place on relatively flat levels.

The missing options are;

a. blocking high views

b. destroying animal habitats

c. overrunning farmland

d. reducing green space

Read more about urban sprawl at; brainly.com/question/504389

8 0
2 years ago
A converging-diverging nozzle has an area ratio of 5.9. (1) Determine the (P0/Pt) values corresponding to the 1st, 2nd, and 3rd
nata0808 [166]

Answer:

Check the explanation

Explanation:

The Total pressure is the overall of fixed or static pressure p, the dynamic pressure q, as well as gravitational head. Total pressure can also be referred to as the measure of the overall energy of the airstream, and is the same to static pressure plus velocity pressure.

kindly check the step by step solution in the attached image below to Determine the (P0/Pt) values corresponding to the 1st, 2nd, and 3rd critical points.

5 0
3 years ago
Other questions:
  • An overhead 25m long, uninsulated industrial steam pipe of 100mm diameter is routed through a building whose walls and air are a
    9·1 answer
  • Calculate the impedance of a 20 mH inductor at a frequency of 100 radians/s. Calculate the impedance of a 500 µF inductor at a f
    9·2 answers
  • Represent the following sentence by a Boolean expression:
    11·1 answer
  • Q1. In electronic circuits it is not unusual to encounter currents in the microampere range. Assume a 35 μA current, due to the
    13·1 answer
  • Extra Credit: The Linc (parking lot and stadium)In celebration of the upcoming Super Bowl, for a maximum 10 points of extra cred
    7·1 answer
  • A pool of contaminated water is lined with a 40 cm thick containment barrier. The contaminant in the pit has a concentration of
    11·1 answer
  • potential difference is the work done in moving a unit positive charge from one point to another in an electric field. State Tru
    12·1 answer
  • What are wheel cylinders used for?
    6·1 answer
  • Which statement describes the relay between minerals and rocks ?
    15·1 answer
  • You have three gear wheels a, b and c connected to each other,if you turn the first gear wheel "a" clockwise what will happen to
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!