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
Joe Bruin has a big lawn in front of his house that is 30 meters wide and 20 meters long. Josephine makes him go out and mow the
zysi [14]

<u>Explanation:</u>

5 Horsepower for 30 mins,

(5)(745.7) = 3.7285 KW power delivered

General Efficiency of IC engine = 20%

Power required = \frac{3 \cdot 7285}{0 \cdot 2}=18 \cdot 6425 kw

Energy required per week,

=P × Time = 18.64 × 60 × 30 = 33.5565 MJ

Lawn area = (30) (20) = 600m^{2}

let sunlight hours be 8 hours

Hence, solar power input on lawn,

=5.62×3600 = 20232 kJ/m^{2}/day

energy input in lawn = (600) (20232) (7)

                                  = 84974.4 mJ/week

Chemical efficiency by photosynthesis = 4%

Chemical content in grass = (84974.4) (0.04)

                                            = 3398.97 mJ

Mass of the clippers  \(=(30)(20)(1 \cdot 096)^{2}(667)\)

                                  \(=478632 \cdot 33\) pounds

Removing water content,

dried grass clippings \(=95726.46\) pound

                                    = 11533.25 gallons

Trash cans repaired  

                                     =\frac{11533}{50} =230.66\\=231 cans

By burning the gas, total energy input = 3398.97 MJ × 0.2

                                                                = 679.794 MJ

Efficiency of steeling engine  =  20%

Energy output by engine = 679.794 ×0.2

                                          = 135.96 mJ

Energy required by mover = 33.5565 mJ

Hence, Energy (output) ⇒ energy required

5 0
3 years ago
What factors are likely to promote the formation of stress corrosion cracks?
Naddika [18.5K]

Answer:

Stress corrosion cracking

Explanation:

This occurs when susceptible materials subjected to an environment that causes cracking effect by the production of folds and tensile stress. This also depends upon the nature of the corrosive environment.

Factors like high-temperature water, along with Carbonization and chlorination, static stress, and material properties.

7 0
3 years ago
Why might construction crews want to install pipes before the foundation is poured
Crazy boy [7]

The answer is choice C

Explanation:

As during construction ,the site is cleared for all debris before laying out the foundation. Even the sewer lines are dug out .

So it will be useful for the construction crews to  connect the pipes to the sewer lines before the foundation is poured.

But usually the steps take in construction activity is:- first the site is cleared for the foundation to be poured  and once the foundation wall is set , then all utilities , including plumbing and electrical activities are done.,

After this process is over, the city inspector comes to check whether the foundation has been laid down as per the code of construction.

Only after that the rest of the construction activity follows through.

3 0
3 years ago
A shunt regulator utilizing a zener diode with an incremental resistance of 8 ohm is fed through an 82-Ohm resistor. If the raw
spayn [35]

Answer:

\triangle V_0=0.08V

Explanation:

From the question we are told that:

Incremental resistance  R=8ohms

Resistor Feed R_f=82ohms

Supply Change \triangle V=1

Generally the equation for  voltage rate of change is mathematically given by

 \frac{dV_0}{dV}=\frca{R}{R_1r_3}

Therefore

 \triangle V_0=\triangle V*\frac{R}{R_fR}

 \triangle V_0=1*\frac{8}{8*82}

 \triangle V_0=0.08V

7 0
3 years ago
Where loads are likely to be on continuously, the calculated load for branch circuits and feeders must be figured at (100%) (125
Anna [14]

Where loads are likely to be on continuously, the calculated load for branch circuits and feeders must be figured at 125%.

Section 210.19(A)(1) permits the bigger of the two values listed below to be utilized as the connectors 's ultimate size for sizing an ungrounded branch circuit conductor:

Without any extra adjustments or corrections, either 125% of the continuous load, OR

When adjustment and corrective factors are applied, the load is 100% (not 125% as stated previously).

This will be the same in the 2020 NEC. The introduction of new exception 2 is what has changed. To comprehend this new exception, one must study it very carefully. A part of a branch circuit connected to pressure connectors (such as power distribution blocks) that complies with 110.14(C)(2) may now be sized using the continuous load plus the noncontiguous load instead of 125% of the continuous load thanks to the new exception.

To know more about connectors click here:

brainly.com/question/16987039

#SPJ4

4 0
1 year ago
Other questions:
  • Biologists use a sequence of letters A, C, T, and G to model a genome. A gene isa substring of a genome that starts after a trip
    5·1 answer
  • The cables of a power line are copper-coated steel wire. The overall diameter of the wire is 5/8 in. The steel core has a diamet
    8·1 answer
  • Find the pressure exerted by the water bed on the floor when the bed rests in its normal position. Assume the entire lower surfa
    12·1 answer
  • Read a 4 character number. Output the result in in the following format, Input 9873, Output 3 *** 7 ******* 8 ******** 9 *******
    8·1 answer
  • A highway reconstruction project is being undertaken to reduce crash rates. The reconstruction involves a major realignment of t
    14·1 answer
  • The coefficient of performance of a reversible refrigeration cycle is always (a) greater than, (b) less than, (c) equal to the c
    12·1 answer
  • The van der Waals equation is a modification of the ideal gas equation. What two factors does this equation account for? A. (1)
    6·1 answer
  • Porque el invento de la bombilla es importante?
    6·1 answer
  • Explain moment of inertia<br>​
    9·1 answer
  • Global climate and weather patterns are driven by differences in the amount of heat energy in different areas of the earth. Whic
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!