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
Explain why the following scenario fails to meet the criteria for proper reverse engineering.
avanturin [10]

Answer:

he must document or remember the order he took it apart so he put it back together

Explanation:

5 0
1 year ago
Q.14
Kay [80]

Answer:

A. optical isolation

Explanation:

well I can't really give a good explanation because I also saw the same question in my exams and option A was the correct answer

6 0
2 years ago
1. A thin plate of a ceramic material with E = 225 GPa is loaded in tension, developing a stress of 450 MPa. Is the specimen lik
mina [271]

Answer:

fracture will occur as the value is less than E/10 (= 22.5)

Explanation:

If the maximum strength at tip Is greater than theoretical fracture strength value then fracture will occur and if the maximum strength is lower than theoretical fracture strength then no fracture will occur.

\sigma_m = 2\sigma_o [\frac{a}{\rho_t}]^{1/2}

=  2\times 750 (\frac{\frac{0.2mm}{2}}{0.001 mm}})^{1/2}

                 = 15 GPa

fracture will occur as the value is less than E/10 = 22.5

7 0
3 years ago
what are some questions about simple machines that don't make me sound like i didn't pay attention in the lesson?
Margaret [11]

Answer:

what are simple machines?

Explanation:

it is 2020 let's be honest all

8 0
3 years ago
A loss in value caused by an undesirable or hazardous influence offsite is which type of depreciation?
Lubov Fominskaja [6]

External depreciation may be defined as a loss in value caused by an undesirable or hazardous influence offsite.

<h3>What is depreciation?</h3>

Depreciation may be defined as a situation when the financial value of an acquisition declines over time due to exploitation, fray, and incision, or obsolescence.

External depreciation may also be referred to as "economic obsolescence". It causes a negative influence on the financial value gradually.

Therefore, it is well described above.

To learn more about Depreciation, refer to the link:

brainly.com/question/1203926

#SPJ1

5 0
1 year ago
Other questions:
  • The net potential energy EN between two adjacent ions, is sometimes represented by the expression
    13·1 answer
  • The wheel and the attached reel have a combined weight of 50lb and a radius of gyration about their center of 6 A k in = . If pu
    9·1 answer
  • The 40-ft-long A-36 steel rails on a train track are laid with a small gap between them to allow for thermal expansion. Determin
    8·1 answer
  • Is normally a large red cable connected to the battery
    11·2 answers
  • Which permission do you need to shoot on the owner’s property?
    8·1 answer
  • The Hubble Space Telescope is an optical imaging telescope with extremely good angular resolution. Someone discovers an object t
    13·1 answer
  • Define ways in which you would go about networking to explore opportunities in your career field and obtain more information for
    11·1 answer
  • Compute the solution to x + 2x + 2x = 0 for Xo = 0 mm, vo = 1 mm/s and write down the closed-form expression for the response.
    8·1 answer
  • Which statement describes a possible limitation on a experimental design? A. Collecting samples to analyze is expensive B. The e
    6·2 answers
  • based on the graph shown, for any given output level, the veritcal distance between the avc and the atc curves represents
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!