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]
4 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]4 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
I hit someone with my car because he tried to hijack it.
Dmitry [639]
Depends on your defense and probably
7 0
3 years ago
Read 2 more answers
If an elevator repairer observes that cables begin to fray after 15 years, what process might he or she use to create a maintena
otez555 [7]

Answer:

inductive reasoning

Explanation:

Inductive reasoning is one of the type of reasoning method in which generalized consequences are derived from limited observations. By observing few data, general conclusions are drawn. The conclusions drawn are false in inductive reasoning. In the given situation, the conclusion drawn by the elevator repairer has been drawn by inductive reasoning. His observation of some cables led him to draw the conclusion about all the cables. The result of the reasoning is false.

5 0
3 years ago
2.11 Consider a 400 mm × 400 mm window in an aircraft. For a temperature difference of 90°C from the inner to the outer surface
alexandr402 [8]

Answer:

The heat loss rate through one of the windows made of polycarbonate is 252W. If the window is made of aerogel, the heat loss rate is 16.8W. If the window is made of soda-lime glass, the heat loss rate is 1190.4W.

The cost associated with the heat loss through the windows for an 8-hour flight is:

For aerogel windows: $17.472 (most efficient)

For polycarbonate windows: $262.08

For soda-lime glass windows: $1,238.016 (least efficient)

Explanation:

To calculate the heat loss rate through the window, we can use a model of heat transmission by conduction throw flat wall. Using unidimensional Fourier law:

\frac{dQ}{dt}=\dot Q =-kS\nabla \vec{T}

In this case:

\dot Q =k\frac{S}{L} \Delta T

If we replace the data provided by the problem we get the heat loss rate through one of the windows of each material (we only have to change the thermal conductivities).

To obtain the thermal conductivity of the soda-lime glass we use the graphic attached to this answer (In this case for soda-lime glass k₃₀₀=0.992w/m·K).

To calculate the cost associated with the heat loss through the windows for an 8-hour flight we use this formula (using the heat loss rate calculated in each case):

Cost=C_{hc}\cdot \dot Q \cdot t \cdot n=1\frac{\$}{Kwh} \cdot \dot Q \cdot 8h \cdot 130

6 0
3 years ago
I really need some help here!
Virty [35]

Explanation:

<h3>1.*Frame Structure have joins which keep them together whereas Shell Structure have no joins.</h3><h3>*Shell Structure usually only support their own weight whereas Frame Structure support others weight as well as themselve.</h3>
7 0
3 years ago
Consider steady one-dimensional heat conduction through a plane wall, a cylindrical shell, and a spherical shell of uniform thic
DIA [1.3K]

Answer:

Plane shell which is option b

Explanation:

The temperature in the case of a steady one-dimensional heat conduction through a plane wall is always a linear function of the thickness. for steady state dT/dt = 0

in such case, the temperature gradient dT/dx, the thermal conductivity are all linear function of x.

For a plane wall, the inner temperature is always less than the outside temperature.

6 0
4 years ago
Other questions:
  • Determine the following for a south facing surface at 30� slope in
    9·1 answer
  • A measure of the probability, consequences, and exposure related to an event is referred to as a. safety b. evaluation c. risk d
    14·1 answer
  • Students are expected to respond to one of the two questions described below. Students should provide examples to clarify their
    12·1 answer
  • A wastewater treatment plant has two primary clarifiers, each 20m in diameter with a 2-m side-water depth. the effluent weirs ar
    8·1 answer
  • 3. (9 points) A square-thread power screw is used to raise or lower the basketball board in a gym, the weight of which is W = 10
    12·1 answer
  • Which of the following power generation technologies produces a direct current?
    9·1 answer
  • Consider the thermocouple and convection conditions of Example 1, but now allow for radiation exchange with the walls of a duct
    8·1 answer
  • Hot liquid is flowing in a steel pipe with an inner diameter of D, = 22 mm and an outer diameter of D2 = 27 mm. The inner surfac
    10·1 answer
  • What would the Select lines need to be to send data for the fifth bit in an 8-bit system (S0 being the MSB and S2 being the LSB)
    11·1 answer
  • what do you expect the future trends of an operating system in terms of (a) cost (b) size (c) multitasking (d) portability (e) s
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!