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
Which of the following allows team members to visualize a design model from a variety of perspectives?
julsineya [31]

Answer: from what i know im pretty sure its isometrics or sketches im certain its sketches but not 100%

Explanation: A sketch is a rapidly executed freehand drawing that is not usually intended as a finished work. A sketch may serve a number of purposes: it might record something that the artist sees, it might record

8 0
3 years ago
Read 2 more answers
What kind of energy transformation happens when a boy uses energy from a sandwich to run a race​
Semmy [17]
A boy eat a energy of a sandwich to run a race because when they eat a sandwich it helps them to help it mid workout and real nutritions of NYC and bring extra fuel and eating the right thing
I hope this help
4 0
2 years ago
Read 2 more answers
What engine does the Mercedes 400e have?
Verdich [7]

Answer:

4.2 m119

Explanation:

it has the 4.2 m119 v8 engine with a top speed of 155 mph and 0 - 60 mph in 6.2 seconds

4 0
3 years ago
Water at atmospheric pressure boils on the surface of a large horizontal copper tube. The heat flux is 90% of the critical value
masya89 [10]

Answer:

The tube surface temperature immediately after installation is 120.4°C and after prolonged service is 110.8°C

Explanation:

The properties of water at 100°C and 1 atm are:

pL = 957.9 kg/m³

pV = 0.596 kg/m³

ΔHL = 2257 kJ/kg

CpL = 4.217 kJ/kg K

uL = 279x10⁻⁶Ns/m²

KL = 0.68 W/m K

σ = 58.9x10³N/m

When the water boils on the surface its heat flux is:

q=0.149h_{fg} \rho _{v} (\frac{\sigma (\rho _{L}-\rho _{v})}{\rho _{v}^{2} }  )^{1/4} =0.149*2257*0.596*(\frac{58.9x10^{-3}*(957.9-0.596) }{0.596^{2} } )^{1/4} =18703.42W/m^{2}

For copper-water, the properties are:

Cfg = 0.0128

The heat flux is:

qn = 0.9 * 18703.42 = 16833.078 W/m²

q_{n} =uK(\frac{g(\rho_{L}-\rho _{v})     }{\sigma })^{1/2} (\frac{c_{pL}*deltaT }{c_{fg}h_{fg}Pr  } \\16833.078=279x10^{-6} *2257x10^{3} (\frac{9.8*(957.9-0.596)}{0.596} )^{1/2} *(\frac{4.127x10^{3}*delta-T }{0.0128*2257x10^{3}*1.76 } )^{3} \\delta-T=20.4

The tube surface temperature immediately after installation is:

Tinst = 100 + 20.4 = 120.4°C

For rough surfaces, Cfg = 0.0068. Using the same equation:

ΔT = 10.8°C

The tube surface temperature after prolonged service is:

Tprolo = 100 + 10.8 = 110.8°C

8 0
3 years ago
You work for a printing company, and you realize that your colleague sent incorrect price quotes to a client. You begin to write
xxTIMURxx [149]

Answer:

The sentence excerpted from the e-mail uses passive voice.  

Given the  purpose of your message, this voice is appropriate.

Explanation:

Because the objective is to remedy the situation a passive voice is great because it emphasizes the action and the object instead of the subject.

We want to emphasize the document and the incorrect information, not our colleague.

4 0
3 years ago
Other questions:
  • A jetliner flying at an altitude of 10,000 m has a Mach number of 0.5. If the jetliner has to drop down to 1000 m but still main
    11·1 answer
  • Policy makers in the U.S. government have long tried to write laws that encourage growth in per capita real GDP. These laws typi
    6·1 answer
  • When the vessel and its contents are warmed to 100 °C, Q decomposes into its constituent elements. What is the total pressure, a
    11·1 answer
  • You have designed a treatment system for contaminant Z. The treatment system consists of a pipe that feeds into a CSTR. The pipe
    8·1 answer
  • PLEASE ANSWER FOR DRIVERS ED! WILL GIVE BRAINLIEST
    10·1 answer
  • I need answers for this sheet please.
    15·1 answer
  • Describe three parts of a fluid power system and the roles played by each to make the device work.
    8·1 answer
  • The parts of a feature control frame are the tolerance value, the datum references, and the
    14·1 answer
  • A homeowner consumes 260 kWh of energy in July when the family is on vacation most of the time. Determine the average cost per k
    7·1 answer
  • Nguyên lý hoạt động của kim phun
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!