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
Cold forging makes metal more workable than hot forging.<br> True<br> False
Whitepunk [10]

Answer:

I don't really know but i have some info for you...

Explanation:

The cold forging manufacturing process increases the strength of a metal through strain hardening at a room temperature. On the contrary the hot forging manufacturing process keeps materials from strain hardening at high temperature, which results in optimum yield strength, low hardness and high ductility.

7 0
3 years ago
Read 2 more answers
Choose the three questions that an engineer should ask himself or herself when identifying the need of a problem.
boyakko [2]

Answer:

What is the goal? What will a successful solution look like? What is it that the client expects me to accomplish?

Explanation:

5 0
2 years ago
Read 2 more answers
If you want to obtain a Class E license before you turn 18, you must______. A. be in compliance with school attendance requireme
Makovka662 [10]

Answer:

The correct option is;

A. be in compliance with school attendance requirements

Explanation:

The requirements to acquire a special restricted driver's license for driver's license for under under 18 that have had a beginner's for up to 180 days include a minimum of 40 hours driving practice 10 of which should be in the dark. The application for the conditional drivers license is to be signed by the parent or guardian and the application is to be accompanied with proof of acceptable school attendance

At 17, after holding the special restricted drivers licence for a year without issues you can obtain the full drivers license.

7 0
3 years ago
Suppose the loop is moving toward the solenoid (to the right). Will current flow through the loop down the front, up the front,
Tems11 [23]

Answer:

See explanation

Explanation:

The magnetic force is

F = qvB sin θ

We see that sin θ = 1, since the angle between the velocity and the direction of the field is 90º. Entering the other given quantities yields

F

=

(

20

×

10

−

9

C

)

(

10

m/s

)

(

5

×

10

−

5

T

)

=

1

×

10

−

11

(

C

⋅

m/s

)

(

N

C

⋅

m/s

)

=

1

×

10

−

11

N

6 0
3 years ago
Read 2 more answers
Regeneration can only increase the efficiency of a Brayton cycle when working fluid leaving the turbine is hotter than the worki
storchak [24]

Answer:

True, <em>Regeneration is the only process where increases the efficiency of a Brayton cycle when working fluid leaving the turbine is hotter than working fluid leaving the compressor</em>.

Option: A

<u>Explanation: </u>

To increase the efficiency of brayton cycle there are three ways which includes inter-cooling, reheating and regeneration. <em>Regeneration</em> technique <em>is used when a turbine exhaust fluids have higher temperature than the working fluid leaving the compressor of the turbine. </em>

<em>Thermal efficiency</em> of a turbine is increased as <em>the exhaust fluid having higher temperatures are used in heat exchanger where the fluids from the compressor enters and increases the temperature of the fluids leaving the compressor. </em>

6 0
3 years ago
Read 2 more answers
Other questions:
  • A high-voltage direct-current (dc) transmission line between Celilo, Oregon and Sylmar, California is 845 mi in length. The line
    15·1 answer
  • The evaporator section of a refrigeration unit consists of thin-walled, 10-mm-diameter tubes through which refrigerant passes at
    7·1 answer
  • Our goal is to design a traffic-light controller with the following properties; it lights up the green light (output G) for 15 s
    7·1 answer
  • an existing highway-railway at-grade crossing is being redesigned as grade separated to improve traffic operations. The railway
    8·1 answer
  • Two hemispherical shells of inner diameter 1m are joined together with 12 equally spaced bolts. If the interior pressure is rais
    15·1 answer
  • I'm really bad at measurements so I don't understand this.
    12·1 answer
  • What learning is required to become a mechanical engineer?
    14·1 answer
  • A 240-ton tugboat is moving at 6 ft/s with a slack towing cable attached to a 100-ton barge that is at rest. The cable is being
    14·1 answer
  • Advanced manufacturing does NOT serve the transportation, communications, or medical industries. Is this statement TRUE or FALSE
    11·2 answers
  • Technician A says that synthetic blend oil has the same service life as that of full synthetic oils. Technician B says that conv
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!