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
irina1246 [14]
3 years ago
12

You are given a collection of n bottles of different widths and n lids of different widths and you need to find which lid goes w

ith which bottle. You can compare a lid to a bottle, from which you can determine if the lid is larger than the bottle, smaller than the bottle, or the correct size. However, there is no way to compare the bottles or the lids directly to each other, i.e. you can’t compare lids to lids or bottles to bottles. Design an algorithm for this problem with an average-case efficiency of Θ(nlgn)
Engineering
1 answer:
Sladkaya [172]3 years ago
5 0

Answer:

void bubble_sort( int A[ ], int n ) {

     int temp;

     for(int k = 0; k< n-1; k++) {

          // (n-k-1) to ignore comparisons of already compared iterations

         for(int i = 0; i < n-k-1; i++) {

                 if(A[ i ] > A[ i+1] ) {

                      // swapping occurs here

                      temp = A[ i ];

                      A[ i ] = A[ i+1 ];

                      A[ i + 1] = temp ;

                  }

          }

    }

}

You might be interested in
In the idealized Otto cycle, heat is added during: a. Isentropic Compression b. Constant (minimum) volume c. Constant (maximum)
docker41 [41]

Answer:

(b) Constant (minimum) volume

Explanation:

In the idealized Otto cycle there are 4 process that are

  • Reversible adiabatic compression  
  • Addition of heat at constant volume
  • Reversible adiabatic expansion
  • Rejection of constant volume

So from above discussion we can see that heat is added when there is constant (minimum) volume which is given in option (b) so option (b) will be the correct answer

3 0
3 years ago
The electron beam in a TV picture tube carries 1015 electrons per second. As a design engineer, determine the voltage needed to
leonid [27]

Answer:

The voltage needed to accelerate the electron beam is 2.46 x 10^16 Volts

Explanation:

The rate of electron flow is given as:

q = 1015 electrons per second

The total current is given by:

Total Current = (Rate of electron flow)(Charge on one electron)

Total Current = I = (1015 electrons/s)(1.6 x 10^-19 C/electron)

I = 1.624 x 10^-16 A

Now, we know that electric power is given as:

Electric Power = Current x Voltage

P = IV

V = P/I

V = 4 W/1.624 X 10^-16 A

<u>V = 2.46 x 10^16 Volts</u>

6 0
3 years ago
This road sign means
Llana [10]

Answer:

B. Steep Downhill Ahead

3 0
3 years ago
Read 2 more answers
in verification of ohms law the mass is 100g, initial length is 31, final length is 31.3 what is the extension?​
MissTica

Answer:

24

Explanation:

6 0
3 years ago
What are the constraints of the problem for thermoforming
Inga [223]

Answer:

here are four options so you can choose the ones of your choice.

Explanation:

1. warpage

2 Dimensional Inconsistencies

3 Part Thickness Inconsistencies

4 Lack of Detail in Part Geometry and Aesthetics

please rate brainliest if helps and follow

6 0
2 years ago
Other questions:
  • Water circulates throughout a house in a hot water heating system. If the water is pumped at a speed of 0.50m/s through a 4.0-cm
    5·1 answer
  • A sleeve made of SAE 4150 annealed steel has a nominal inside diameter of 3.0 inches and an outside diameter of 4.0 inches. It i
    9·2 answers
  • A closed system contains propane at 35°c. It produces 35 kW of work while absorbing 35 kW of heat. What is process? the temperat
    7·1 answer
  • Show that a chirped Gaussian pulse is compressed initially inside a single-mode fiber when ftC &lt; 0. Derive expressions for th
    12·1 answer
  • If you are running and you fall and everyone↓↓↓↓↓↓↓ passes you how can you still be in first place??
    12·1 answer
  • What type of siege engines were used by Saladin to capture Jerusalem in 1187?
    8·1 answer
  • Vehicles arrive at a recreational park booth at a uniform deterministic rate of 5 veh/min. If uniform deterministic processing o
    12·1 answer
  • Which statement describes the wave pattern of a high pitch
    7·1 answer
  • Find the remaining trigonometric function of 0 if
    13·1 answer
  • When converting liquid level units to sensor output signal units, you should first convert the liquid level units to _____ units
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!