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
chubhunter [2.5K]
4 years ago
8

If necessary, open the Cleanup Animator and choose the Shuffle Left algorithm from the Select Algorithm drop-down list. Click Ru

n and observe the "loop inside a loop" nature of this algorithm by watching the animation. The general idea is that the L marker moves to the right trying to detect 0s. Each time it detects a 0, the R marker moves to the right, shuffling the data items to the left. Try this three or four times, remembering to click Reset to prepare for each run. Suppose the original data set consists of these numbers: What is the final arrangement of the data when the algorithm terminates?
Engineering
1 answer:
jek_recluse [69]4 years ago
3 0

Answer:

A = 42 32 0 0 0 77 23 71 is the list of numbers taken here as the question is incomplete.

L marker moves to the right trying to detect 0s. Each time it detects a 0, the R marker moves to the right, shuffling the data items to the left.

Get the array, A and its size, n

L = 1

R = 2

Repeat the following steps until left > legit

if AL ≠ 0

L ++

R ++

else

legit --

Repeat the following steps until right > n

Copy AR to AR

R ++

R = L + 1

stop

Explanation: The arrangement of data is as follows:

A = 42 32 0 0 0 77 23 71

N = 8; L= 1; R = 2

Iteration 1: 42 ≠ 0 => L = 2; R = 3

A = 42 32 0 0 0 77 23 71

Iteration 2: 32 ≠ 0 => L = 3; R = 4

A = 42 32 0 0 0 77 23 71

Iteration 3: 0 = 0 => N = 7

Copy the remaining elements one position to its left

A = 42 32 0 0 77 23 71

Iteration 4: 0 = 0 => N = 6

Copy the remaining elements one position to its left

A = 42 32 0 77 23 71

Iteration 5: 0 = 0 => N = 5

Copy the remaining elements one position to its left

A = 42 32 77 23 71

Iteration 6: 77 ≠ 0 => L = 4; R = 5

A = 42 32 77 23 71

Iteration 7: 23 ≠ 0 => L= 5; R = 6

A = 42 32 77 23 71

Iteration 8: 71 ≠ 0 => L= 6; R = 7

A = 42 32 77 23 71

L > N ---- stop

final arrangement of the data when the algorithm terminates

42 32 77 23 71

You might be interested in
A spherical balloon with a diameter of 9 m is filled with helium at 20°C and 200 kPa. Determine the mole number and the mass of
SIZIF [17.4K]

Answer:

<em>number of mole is 31342.36 moles</em>

<em>mass is 125.369 kg</em>

<em></em>

Explanation:

Diameter of the spherical balloon d = 9 m

radius r = d/2 = 9/2 = 4.5 m

The volume pf the sphere balloon ca be calculated from

V = \frac{4}{3} \pi r^3

V = \frac{4}{3}* 3.142* 4.5^3 = 381.75 m^3

Temperature of the gas T = 20 °C = 20 + 273 = 293 K

Pressure of the helium gas = 200 kPa = 200 x 10^3 Pa

number of moles n = ?

Using

PV = nRT

where

P is the pressure of the gas

V is the volume of the gas

n is the mole number of the gas

R is the gas constant = 8.314 m^3⋅Pa⋅K^−1⋅mol^−1

T is the temperature of the gas (must be converted to kelvin K)

substituting values, we have

200 x 10^3 x 381.75 = n x 8.314 x 293

number of moles n  = 76350000/2436 = <em>31342.36 moles</em>

We recall that n = m/MM

or m = n x MM

where

n is the number of moles

m is the mass of the gas

MM is the molar mass of the gas

For helium, the molar mass = 4 g/mol

substituting values, we have

m = 31342.36 x 4

m = 125369.44 g

m =<em> 125.369 kg</em>

3 0
3 years ago
Which two statements about professional technical jobs in the energy industry are correct?
Tanya [424]
The answer is both B and D
4 0
3 years ago
Read 2 more answers
The A-36 steel drill shaft of an oil well extends 12 000 ft into the ground. Assuming that the pipe used to drill the well is su
sladkih [1.3K]

check photo solvecheck photo solve

3 0
3 years ago
Which of the following have had a significant impact on the automotive industry?
WARRIOR [948]
All of the above (hope that helps!)
6 0
3 years ago
A series circuit has 4 identical lamps. The potential difference of the energy source is 60V. The total resistance of the lamps
Alexxx [7]

Answer:

I=3A

Explanation:

From the question we are told that:

Number of lamps N=4

Potential difference V=60v

Total Resistance of the lamp is R= 20ohms

Generally the equation for Current I is mathematically given by

 I=\frac{V}{R}

 I=\frac{60}{20}

 I=3A

8 0
3 years ago
Other questions:
  • The combustion of the paraffin oil, which is a highly refined fossil fuel product similar to kerosene composed of C14-C16 hydroc
    8·1 answer
  • 4) Determine fatigue correction factors for the 0.4 inch DIA shaft from H04 using ground normailzed 4140 steel. The shaft is in
    6·1 answer
  • To measure the voltage drop across a resistor, a _______________ must be placed in _______________ with the resistor. Ammeter; S
    9·1 answer
  • Market research is a good place to start the design process and usually involves asking questions about consumers.
    5·1 answer
  • 3. How can statistical analysis of a dataset inform a design process?
    7·1 answer
  • Q4. The gross command area of canal is
    6·1 answer
  • Microstructures are microscopic additions or forms in a system.<br> True<br> O False
    7·2 answers
  • 10.16.1: LAB: Interstate highway numbers (Python)
    9·1 answer
  • Which symbol warns that there is something wrong with your alternator?
    8·1 answer
  • Người ta sử dụng hệ thống cô đặc 3 nồi xuôi chiều tuần hoàn tự nhiên để cô đặc dung dịch đường có suất lượng 10 tấn/giờ từ nồng
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!