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
Annette [7]
3 years ago
12

Given an unsorted array of distinct positive integers A[1..n] in the range between 1 and 10000 and an integer i in the same rang

e. Here n can be arbitrary large. You want to find out whether there are 2 elements of the array that add up to i. Give an algorithm that runs in time O(n).
Engineering
1 answer:
AnnZ [28]3 years ago
7 0

Answer:

Explanation:

Arbitrary means That no restrictions where placed on the number rather still each number is finite and has finite length. For the answer to the question--

Find(A,n,i)

for j =0 to 10000 do

frequency[j]=0

for j=1 to n do

frequency[A[j]]= frequency[A[j]]+1

for j =1 to n do

if i>=A[j] then

if (i-A[j])!=A[j] and frequency[i-A[j]]>0 then

return true

else if (i-A[j])==A[j] and frequency[j-A[j]]>1 then

return true

else

if (A[j]-i)!=A[j] and frequency[A[j]-i]>0 then

return true

else if (A[j]-i)==A[j] and frequency[A[j]-i]>1 then

return true

return false

You might be interested in
How do the remains of plants and animals become fossil fuels. Why are they considered nonrenewable resources?
Montano1993 [528]

Answer:

they become oils with heat and pressure

they are non-renewable because they take millions of years to form

4 0
3 years ago
When framing a building, a simple way to estimate the total amount of wall studs needed is to allow
Levart [38]
1+1=2
Solution
3:932(2)=61
4 0
2 years ago
A plate clutch is used to connect a motor shaft running at 1500rpm to shaft 1. The motor is rated at 4 hp. Using a service facto
vazorg [7]

Answer:

(M_t)_{rated}=61.11lb-in

Explanation:

speed of motor (N)=1500 rpm

power=4 hp = 4 \times 0.7457 =2.9828 KW

service factor(k)= 2.75

now,

KW=\frac{2\pi n M_t}{60 \times 10^6} \\2.9828=\frac{2\pi \times 1500 M_t}{60 \times 10^6}\\M_t=\frac{2.9828\times 60 \times 10^6}{2\pi \times 1500 }

M_t= 18,989.09 \ N-mm= 168.06 lb-in

torque rating

(M_t)_{design}=k_s\times (M_t)_{rated}\\168.06= 2.75\times (M_t)_{rated}\\(M_t)_{rated}=\frac{168.06}{2.75} \\(M_t)_{rated}=61.11lb-in

4 0
3 years ago
Which of the following are all desirable properties of a hydraulic fluid? a. good heat transfer capability, low viscosity, high
Vinvika [58]

Answer:

e.Fire resistance,Inexpensive,Non-toxic.

Explanation:

Desirable hydraulic property of fluid as follows

1. Good chemical and environment stability

2. Low density

3. Ideal viscosity

4. Fire resistance

5. Better heat dissipation

6. Low flammability

7. Good lubrication capability

8. Low volatility

9. Foam resistance

10. Non-toxic

11. Inexpensive

12. Demulsibility

13. Incompressibility

So our option e is right.

5 0
2 years ago
A rectangular open box, 25 ft by 10 ft in plan and 12 ft deep weighs 40 tons. Sufficient amount of stones is placed in the box a
dimulka [17.4K]

Answer:

44.95 tonnes

Explanation:

According to principle of buoyancy the object will just sink when it's weight is more than the weight of the liquid it displaces

It is given that empty weight of box = 40 tons

Let the mass of the stones to be placed be = M tonnes

Thus the combined mass of box and stones = (40+M) tonnes..........(i)

Since the box will displace water equal to it's volume V we have volume of box = 25ft*10ft*12ft= 3000ft^{3}

Volume= 84.95m^{3}

Since 1ft^{3} =0.028m^{3}

Now the weight of water displaced = Weight =\rho \times Volumewhererho is density of water = 1000kg/m^{3}

Thus weight of liquid displaced = \frac{84.95X1000}{1000}tonnes=84.95 tonnes..................(ii)

Equating i and ii we get

40 + M = 84.95

thus Mass of stones = 44.95 tonnes

3 0
3 years ago
Other questions:
  • The reverse water-gas shift (RWGS) reaction is an equimolar reaction between CO2 and H2 to form CO and H2O. Assume CO2 associati
    10·1 answer
  • Are spheroidized steels considered as composite? If so, what is the dispersed phase a)- No b)- Yes, Chromium Carbides c)- Yes, I
    12·1 answer
  • The amount of time an activity can be delayed and yet not delay the project is termed:_________
    14·1 answer
  • ____ technologies are new technologies that are not currently widely employed.
    15·2 answers
  • Arc blow typically occurs in steel and metals that contain iron.<br> True or false
    7·2 answers
  • An aggregate blend is composed of 65% coarse aggregate by weight (Sp. Cr. 2.635), 36% fine aggregate (Sp. Gr. 2.710), and 5% fil
    5·1 answer
  • Please help me with this. Picture
    10·1 answer
  • أجوبة على مسائل في الإستاتيكا أيمكن ذالك
    9·1 answer
  • 3. Aqueous cleaners are
    11·1 answer
  • Write down the three formula to find the three types of slope of curve Q with respect to L.
    5·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!