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
AysviL [449]
2 years ago
11

Suppose you have two arrays: Arr1 and Arr2. Arr1 will be sorted values. For each element v in Arr2, you need to write a pseudo c

ode that will print the number of elements in Arr1 that is less than or equal to v. For example: suppose you are given two arrays of size 5 and 3 respectively. 5 3 [size of the arrays] Arr1 = 1 3 5 7 9 Arr2 = 6 4 8 The output should be 3 2 4 Explanation: Firstly, you should search how many numbers are there in Arr1 which are less than 6. There are 1, 3, 5 which are less than 6 (total 3 numbers). Therefore, the answer for 6 will be 3. After that, you will do the same thing for 4 and 8 and output the corresponding answers which are 2 and 4. Your searching method should not take more than O (log n) time. Sample Input Sample Output 5 5 1 1 2 2 5 3 1 4 1 5 4 2 4 2 5
Engineering
1 answer:
brilliants [131]2 years ago
6 0

Answer:

The algorithm is as follows:

1. Declare Arr1 and Arr2

2. Get Input for Arr1 and Arr2

3. Initialize count to 0

4. For i in Arr2

4.1 For j in Arr1:

4.1.1 If i > j Then

4.1.1.1 count = count + 1

4.2 End j loop

4.3 Print count

4.4 count = 0

4.5 End i loop

5. End

Explanation:

This declares both arrays

1. Declare Arr1 and Arr2

This gets input for both arrays

2. Get Input for Arr1 and Arr2

This initializes count to 0

3. Initialize count to 0

This iterates through Arr2

4. For i in Arr2

This iterates through Arr1 (An inner loop)

4.1 For j in Arr1:

This checks if current element is greater than current element in Arr1

4.1.1 If i > j Then

If yes, count is incremented by 1

4.1.1.1 count = count + 1

This ends the inner loop

4.2 End j loop

Print count and set count to 0

<em>4.3 Print count</em>

<em>4.4 count = 0</em>

End the outer loop

4.5 End i loop

End the algorithm

5. End

You might be interested in
A steel bar is 150 mm square and has a hot-rolled finish. It will be used in a fully reversed bending application. Sut for the s
Xelga [282]

Answer:

See explanation

Explanation:

Given The bar is square and has a hot-rolled finish. The loading is fully reversed bending.

Tensile Strength

Sut: 600 MPa

Maximum temperature

Tmax: 500 °C

Bar side dimension

b: 150 mm

Alternating stress

σa: 100 MPa

Reliability

R: 0.999 Note 1.

Assumptions Infinite life is required and is obtainable since this ductile steel will have an endurance limit. A reliability factor of 99.9% will be used.

Solution See Excel file Ex06-01.xls.

1 Since no endurance-limit or fatigue strength information is given, we will estimate S'e based on the ultimate tensile strength using equation 6.5a.

S'e: 300 MPa = 0.5 * Sut

2 The loading is bending so the load factor from equation 6.7a is

Cload: 1

3 The part size is greater than the test specimen and the part is not round, so an equivalent diameter based on its 95% stressed area must be determined and used to find the size factor. For a rectangular section in nonrotating bending, the A95 area is defined in Figure 6-25c and the equivalent diameter is found from equation 6.7d

A95: 1125 mm2 = 0.05 * b * b Note 2.

dequiv: 121.2 mm = SQRT(A95val / 0.0766)

and the size factor is found for this equivalent diameter from equation 6.7b, to be

Csize: 0.747 = 1.189 * dequiv^-0.097

4 The surface factor is found from equation 6.7e and the data in Table 6-3 for the specified hot-rolled finish.

Table 6-3 constants

A: 57.7

b: -0.718 Note 3.

Csurf: 0.584 = Acoeff * Sut^bCoeff

5 The temperature factor is found from equation 6.7f :

Ctemp: 0.710 = 1 - 0.0058 * (Tmax - 450)

6 The reliability factor is taken from Table 6-4 for R = 0.999 and is

Creliab: 0.753

7 The corrected endurance limit Se can now be calculated from equation 6.6:

Se: 69.94 MPa = Cload * Csize * Csurf * Ctemp *

Creliab * Sprme

Let

Se: 70 MPa

8 To create the S-N diagram, we also need a value for the estimated strength Sm at 103 cycles based on equation 6.9 for bending loading.

Sm: 540 MPa = 0.9 * Sut

9 The estimated S-N diagram is shown in Figure 6-34 with the above values of Sm and Se. The expressions of the two lines are found from equations 6.10a through 6.10c assuming that Se begins at 106 cycles.

b: -0.2958 Note 4.

a: 4165.7

Plotting Sn as a function of N from equation 6.10a

N Sn (MPa)

1000 540 =aa*B73^bb

2000 440

4000 358

8000 292

16000 238

32000 194

64000 158

128000 129

256000 105

512000 85

1000000 70

FIGURE 6-34. S-N Diagram and Alternating Stress Line Showing Failure Point

10 The number of cycles of life for any alternating stress level can now be found from equation 6.10a by replacing σa for Sn.

At N = 103 cycles,

Sn3: 540 MPa = aa * 1000^bb

At N = 106 cycles,

Sn6: 70 MPa = aa * 1000000^bb

The figure above shows the intersection of the alternating stress line (σa = 100 MPa) with the failure line at N = 3.0 x 105 cycles.

8 0
2 years ago
A series AC circuit contains a resistor, an inductor of 250 mH, a capacitor of 4.40 µF, and a source with ΔVmax = 240 V operatin
slega [8]

Answer:

Explanation:

Inductance = 250 mH = 250 / 1000 = 0.25 H

capacitance = 4.40 µF = 4.4 × 10⁻⁶ F ( µ = 10⁻⁶)

ΔVmax = 240, f frequency = 50Hz and I max = 110 mA = 110 /1000 = 0.11A

a) inductive reactance = 2πfl =  2 × 3.142 × 50 × 0.25 H =78.55 ohms

b) capacitive reactance = \frac{1}{2\pi fC} = 1 / ( 2 × 3.142× 50 × 4.4 × 10⁻⁶ ) = 723.34 ohms

c) impedance = \frac{Vmax}{Imax} = 240 / 0.11 = 2181.82 ohms

7 0
3 years ago
Read 2 more answers
Experimental Design Application Production engineers wish to find the optimal process for etching circuit boards quickly. They c
Veseljchak [2.6K]

Answer:

Hello your question is incomplete attached below is the missing part and answer

options :

Effect A

Effect B

Effect C

Effect D

Effect AB

Effect AC

Effect AD

Effect BC

Effect BD

Effect CD

Answer :

A  = significant

 B  = significant

C  = Non-significant

D  = Non-significant

AB  = Non-significant

AC  = significant

AD  = Non-significant

BC  = Non-significant

 BD  = Non-significant

 CD = Non-significant

Explanation:

The dependent variable here is Time

Effect of A  = significant

Effect of B  = significant

Effect of C  = Non-significant

Effect of D  = Non-significant

Effect of AB  = Non-significant

Effect of AC  = significant

Effect of AD  = Non-significant

Effect of BC  = Non-significant

Effect of BD  = Non-significant

Effect of CD = Non-significant

8 0
3 years ago
PLZZ HELP
9966 [12]

Answer:

Could ask a family member to help

Explanation:

5 0
3 years ago
Read 2 more answers
A boiler is used to heat steam at a brewery to be used in various applications such as heating water to brew the beer and saniti
Natalija [7]

Answer:

net boiler heat = 301.94 kW

Explanation:

given data

saturated steam = 6.0 bars

temperature = 18°C

flow rate = 115 m³/h = 0.03194 m³/s

heat use by boiler = 90 %

to find out

rate of heat does the boiler output

solution

we can say saturated steam is produce at 6 bar from liquid water 18°C

we know at 6 bar from steam table

hg = 2756 kJ/kg

and

enthalpy of water at 18°C

hf = 75.64 kJ/kg

so heat required for 1 kg is

=hg - hf

= 2680.36 kJ/kg

and

from steam table specific volume of saturated steam at 6 bar is 0.315 m³/kg

so here mass flow rate is

mass flow rate = \frac{0.03194}{0.315}

mass flow rate m = 0.10139 kg/s

so heat required is

H = h × m  

here h is heat required and m is mass flow rate

H = 2680.36  × 0.10139

H =  271.75 kJ/s = 271.75 kW

now 90 % of boiler heat is used for generate saturated stream

so net boiler heat = \frac{H}{0.90}

net boiler heat = \frac{271.75}{0.90}

net boiler heat = 301.94 kW

5 0
3 years ago
Other questions:
  • Students are expected to respond to one of the two questions described below. Students should provide examples to clarify their
    12·1 answer
  • A cylindrical specimen of this alloy 12.7 mm in diameter and 250 mm long is stressed in tension and found to elongate 7.6 mm. On
    5·1 answer
  • 5 lb of propane is contained in a closed, rigid tank initially at 80 lbf/in^2, 110 degrees Fahrenheit. Heat transfer occurs unti
    5·1 answer
  • The following displacement (cm), output (V) data have been recorded during a calibration of an LVDT. Displacement (cm), output (
    15·1 answer
  • Which of the following is not necessary a reason to machine a brake drum?
    8·1 answer
  • Determine the magnitude and the location of the hydrostatic force on the 2m by 4 m vertical rectangular gate shown in Figure P3.
    12·1 answer
  • 6.
    8·1 answer
  • 5. Liam is working on a circuit and notices it's quite hot to the touch. What's causing the heat Liam Is noticing
    6·1 answer
  • Contrast moral and immoral creativity and innovation<br>​
    12·1 answer
  • Describe how you would control employee exposure to excessive noise in a mining environment
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!