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
Select the statement that is false.
ra1l [238]

Answer:

D

Explanation:

the way vertices are connected may be different so having same number of edges do not mean that total degree will also be same.

8 0
3 years ago
If the old radiator is replaced with a new one that has longer tubes made of the same material and same thickness as those in th
Nookie1986 [14]

Answer: hello some parts of your question is missing attached below is the missing information

The radiator of a car is a type of heat exchanger. Hot fluid coming from the car engine, called the coolant, flows through aluminum radiator tubes of thickness d that release heat to the outside air by conduction. The average temperature gradient between the coolant and the outside air is about 130 K/mm . The term ΔT/d  is called the temperature gradient which is the temperature difference ΔT between coolant inside and the air outside per unit thickness of tube

answer : Total surface area = 3/2 * area of old radiator

Explanation:

we will use this relation

K = \frac{Qd }{A* change in T }

change in T =  ΔT  

therefore New Area  ( A ) = 3/2 * area of old radiator

Given that the thermal conductivity is the same in the new and old radiators

3 0
3 years ago
You should use the pass technique a fire extinguisher
PilotLPTM [1.2K]

Answer:

Yes

Explanation:

8 0
3 years ago
Technician A says that 5W-30 would be better to use than 20W-50 in most vehicles in
shtirl [24]
Technician is correct sorry if im wronghg
5 0
3 years ago
Read 2 more answers
FAST PLLZZ!! Ideally, the backrest is tilted back slightly, so when you turn the wheel your shoulders are _______ the seat.
exis [7]

Answer:

touching

Explanation:

The backrest of the seat should be tilted back ever so slightly, and when turning the steering wheel your shoulders should remain in contact with the seat – rather than hunched forward.

8 0
3 years ago
Other questions:
  • You are a designer of a new processor. You have to choose between two possible implementations (called M1 and M2) of the same ar
    5·1 answer
  • Problem 3: Soil Classification using the AASHTO and USCS Systems
    10·1 answer
  • The bulk modulus of a material is 3.5 ✕ 1011 N/m2. What percent fractional change in volume does a piece of this material underg
    13·1 answer
  • 1) Relative to electrons and electron states, what does each of the four quantum numbers specify?
    10·1 answer
  • Transcription machinery assembles at _______________.
    6·1 answer
  • Consider a Carnot refrigeration cycle executed in a closed system in the saturated liquid-vapor mixture region using 0.96 kg of
    11·1 answer
  • What do machines require in order to work?
    12·1 answer
  • who wants points for now work just put any answer who wants points for now work just put any answer who wants points for now wor
    5·1 answer
  • Describe the greatest power in design according to Aravena?
    15·1 answer
  • A(n) _____ is an apparatus that changes alternating current (AC) to direct current (DC)
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!