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
Technician A says that if fuel pump pressure is correct, fuel pump volume will be correct as well. Technician B says that a fuel
guajiro [1.7K]

Answer:

Technician B only

Explanation:

hope this helps :)

5 0
2 years ago
The mathematical model for finite element method in structural mechanics is the
zysi [14]

Explanation:

Conservation of velocity equation

3 0
3 years ago
Read 2 more answers
W10L1-Show It: Pythagorean Theorem<br> Calculate the total material in the picture.<br> 4<br> 3
Fantom [35]

Answer:

35

Explanation: I really dont even know, I just used up all my tries on it and got it wrong on every other thing i chose. So it's 35 i believe cause its the only answer i didnt choose.

7 0
3 years ago
What is the average linear (seepage) velocity of water in an aquifer with a hydraulic conductivity of 6.9 x 10-4 m/s and porosit
jeka94

Answer:

a. 0.28

Explanation:

Given that

porosity =30%

hydraulic gradient = 0.0014

hydraulic conductivity = 6.9 x 10⁻4 m/s

We know that average linear velocity given as

v=\dfrac{K}{n_e}\dfrac{dh}{dl}

v=\dfrac{6.9\times 10^{-4}}{0.3}\times0.0014\ m/s

v=3.22\times 10^{-6}\ m/s

The velocity in m/d      ( 1 m/s =86400 m/d)

v= 0.27 m/d

So the nearest answer is 'a'.

a. 0.28

4 0
2 years ago
Visual perception is a mental process that is non selective<br> True<br> False
NARA [144]

The statement "Visual perception is a mental process that is non selective" is false, it is a psychic function that allows the organism to capture, elaborate and interpret selective information that comes from the environment.

<h2>What is visual perception?</h2>

Visual perception is that inner sensation of apparent knowledge, resulting from a specific stimulus or light impression recorded by the eyes.

<h3>Characteristics of visual perception</h3>

  • It incorporates the sensory stimuli received from objects, situations or events and converts them into a meaningful interpretation experience.

  • It is an active process of the brain through which an external reality is created by transforming the light information captured by the eye.

Therefore, we can conclude that visual perception is the interpretation made by the brain of the different organisms of the stimuli received through the senses.

Learn more about visual perception here: brainly.com/question/10259599

3 0
2 years ago
Other questions:
  • g In the above water treatment facility, chemical concentration (mg/gal) within the tank can be considered uniform. The initial
    8·1 answer
  • As of January 1, 2018, Farley Co. had a credit balance of $534,000 in its allowance for uncollectible accounts. Based on experie
    10·1 answer
  • Which tool is used to pull the tapered shaft on a tie-rod end from its mating steering component?
    9·1 answer
  • Give a reason why fighter aircraft use mid-wing design.
    11·1 answer
  • What type of drawing would civil engineers use if they needed to show an
    11·1 answer
  • 12 times the square root of 8737
    13·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
  • Which option identifies the step skipped in the following scenario?
    9·2 answers
  • A parallel circuit has a resistance of 280 and an inductive reactance of 360 02. What's this circuit's impedance?
    6·1 answer
  • What do you mean by decentralization??​
    15·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!