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]
3 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]3 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
Small droplets of carbon tetrachloride at 68 °F are formed with a spray nozzle. If the average diameter of the droplets is 200 u
Licemer1 [7]

Answer:

the difference in pressure between the inside and outside of the droplets is 538 Pa

Explanation:

given data

temperature = 68 °F

average diameter = 200 µm

to find out

what is the difference in pressure between the inside and outside of the droplets

solution

we know here surface tension of carbon tetra chloride at 68 °F is get from table 1.6 physical properties of liquid that is

σ = 2.69 × 10^{-2} N/m

so average radius = \frac{diameter}{2} =  100 µm = 100 ×10^{-6} m

now here we know relation between pressure difference and surface tension

so we can derive difference pressure as

2π×σ×r = Δp×π×r²    .....................1

here r is radius and  Δp pressure difference and σ surface tension

Δp = \frac{2 \sigma }{r}    

put here value

Δp = \frac{2*2.69*10^{-2}}{100*10^{-6}}  

Δp = 538

so the difference in pressure between the inside and outside of the droplets is 538 Pa

7 0
4 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
How should you move your board through the planer? (Pick two choices.)
iragen [17]

Answer:

I would say do it at an even pace

Explanation:

Doing it a slow pace takes time quickly will probably not to good gor you and doing it at an irregular pace is just way to fast

4 0
3 years ago
Why do we need technical sketching?
Scrat [10]

Technical Drawings give a better understanding of what is needed and required in the project.

Explanation:

8 0
3 years ago
Read 2 more answers
What combustion after effects do actuators work to control
Rufina [12.5K]
Answer: I would help you but I don’t know the answer, so sorry
4 0
3 years ago
Read 2 more answers
Other questions:
  • The period of a pendulum T is assumed to depend only on the mass m, the length of the pendulum `, the acceleration due to gravit
    9·1 answer
  • Air as an ideal gas in a closed system undergoes a reversible process between temperatures of 1000 K and 400 K. The beginning pr
    9·1 answer
  • Two mass streams of the same ideal gas are mixed in a steady-flow chamber while receiving energy by heat transfer from the surro
    11·1 answer
  • Realize the function f(a, b, c, d, e) = Σ m(6, 7, 9, 11, 12, 13, 16, 17, 18, 20, 21, 23, 25, 28)using a 16-to-1 MUX with control
    13·1 answer
  • Emergency plans are being formulated so that rapid action can be taken in the event of an equipment failure. It is predicted tha
    12·2 answers
  • The coolant heat storage system:
    10·1 answer
  • True or false the camshaft is always located in the engine block
    10·1 answer
  • Two solid yellow center lines on a two-lane highway indicate:
    13·2 answers
  • 1. Band saw lower wheel does not require a guard *
    6·1 answer
  • A thin aluminum sheet is placed between two very large parallel plates that are maintained at uniform temperatures T1 = 900 K, T
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!