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
Ow is squeezing toothpaste out of a tube of toothpaste similar to peristalsis?
zavuch27 [327]

Answer:

i dont know

Explanation:

gimme a sec

3 0
3 years ago
A batch of parts is produced on a semi-automated production machine in a sequential batch production operation. Batch quantity i
vredina [299]

Answer:

a) 4.21 min

b) 21.9666 hrs

c) 1.3657 Pc/hr

Explanation:

Given that;

Batch quantity = 300 units

time setup = 55min

unload/loading time = 0.75

processing time = 3.46

a) Average cycle time;

Average Cycle Time TC = loading time + processing time

TC = 0.75 + 3.46

Tc = 4.21 min

b) Time to complete the batch

Time to complete the batch Tb = setup time + process time + non operation time

Tb = (55min * 1hr/60min) + (300 * 3.46 * 1hr/60min) + (300 * 0.75 * 1hr/60min)

Tb = 0.9166 + 17.3 + 3.75

Tb = 21.9666 hrs

c) Average production rate

Average production rate Rp = 1 / ( Tb / batch size)

we substitute

Rp = 1 / ( 21.9666 / 300 )

Rp = 1 / 0.7322

Rp = 1.3657 Pc/hr

4 0
3 years ago
Two 2.30 cm × 2.30 cm plates that form a parallel-plate capacitor are charged to ± 0.708 nC . Part A What is the electric field
Alchen [17]

Answer:

A. E = 1.512\times 10^{5}\ V

B. 151.2 V

C. E = 1.512\times 10^{5}\ V

D. V = 302.4 V

Solution:

As per the question:

Area of the plates of the parallel plate capacitors, A = 2.30\times 2.30 = 5.29\ cm^{2} = 5.29\times 10^{- 4}\ m^{2}

Charge on the plates of the capacitor, Q_{c} = \pm 0.708\ nC = \pm 0.708\times 10^{- 9} \C

Now,

(A) To calculate the electric field strength, E when the separation distance, d = 1.00 mm = 10^{- 3}\ m:

E = \frac{Q}{\epsilon_{o}A}

E = \frac{0.708\times 10^{- 9}}{8.85\times 10^{- 12}\times 5.29\times 10^{- 4}} = 1.512\times 10^{5}\ N/C

(B) To calculate potential difference between the plates:

V = Ed = 1.512\times 10^{5}\times 10^{- 3} = 151.2V

(C) Electric field strength when spacing is 2 mm, i.e., 2\times 10^{- 3}\ m:

E = \frac{Q}{\epsilon_{o}A}

Since, the above expression of the electric field shows that it does not depend on the separation distance between the plates thus it will remain same, i.e., 1.512\times 10^{5}\ V

(D) Potential difference across the capacitor when d = 2\times 10^{- 3}\ m:

V = Ed = 1.512\times 10^{5}\times 2\times 10^{- 3} =302.4\ V

7 0
4 years ago
A stem and leaf display
Crank
5/2055 classes displayed there’s Nooooob changes
3 0
3 years ago
A 400 kg machine is placed at the mid-span of a 3.2-m simply supported steel (E = 200 x 10^9 N/m^2) beam. The machine is observe
Alenkinab [10]

Answer:

moment of inertia = 4.662 * 10^6 mm^4

Explanation:

Given data :

Mass of machine = 400 kg = 400 * 9.81 = 3924 N

length of span = 3.2 m

E = 200 * 10^9 N/m^2

frequency = 9.3 Hz

Wm ( angular frequency ) = 2 \pi f = 58.434 rad/secs

also Wm = \sqrt{\frac{g}{t} }  ------- EQUATION 1

g = 9.81

deflection of simply supported beam

t = \frac{wl^3}{48EI}

insert the value of t into equation 1

Wm^2 = \frac{g*48*E*I}{WL^3}   make I the subject of the equation

I ( Moment of inertia about the neutral axis ) = \frac{WL^3* Wn^2}{48*g*E}

I = \frac{3924*3.2^3*58.434^2}{48*9.81*200*10^9}  = 4.662 * 10^6 mm^4

6 0
3 years ago
Other questions:
  • Paragraph summary on airplane history
    8·1 answer
  • According to OSHA, employers must_____ and _____ hazardous chemicals in the workplace. Which selection completes the sentence to
    14·1 answer
  • The collar A, having a mass of 0.75 kg is attached to a spring having a stiffness of k = 200 N/m . When rod BC rotates about the
    15·1 answer
  • The Republican National Committee publishes a monthly digest of information for Republicans called .
    15·1 answer
  • Which of the following is NOT a problem associated with surface mining?
    13·1 answer
  • Nơi nào có điện tích thì xung quanh điện tích đó có :
    9·1 answer
  • How do statics, Dynamics and Mechanics of materials differ from each other? *
    5·1 answer
  • A dual-fluid heat exchanger has 10 lbm/s water entering at 100 F, 20 psia and leaving at 50 F, 20 psia. The other fluid is glyco
    13·1 answer
  • Applications of attenuators.
    5·1 answer
  • What do you think the top TWO game elements are that directly contribute to player immersion?
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!