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
Convert A'B'C'D' + A'B'C'D + A'B'CD' + A'BC'D + AB'C'D' + AB'C'D+ AB'CD' to SOP form
bazaltina [42]

Answer:

thats really hard how could you answerthis hhhhhhh

6 0
2 years ago
Read 2 more answers
1. The construction process begins with which of the following stages?
Firdavs [7]

Answer:

c) site preparation

Explanation:

A construction process can be defined as a series of important physical events (processes) that must be accomplished during the execution of a construction project.

Generally, in the construction of any physical asset such as offices, hospitals, schools, stadiums etc, the first step of the construction process is site preparation. Site preparation refers to processes such as clearing, blasting, levelling, landfilling, surveying, cutting, excavating and demolition of all unwanted objects on a piece of land, so as to make it ready for use.

This ultimately implies that, site preparation should be the first task to be accomplished in the construction process.

Hence, the construction process typically begins with site preparation before other activities such as the laying of foundation can be done.

Additionally, construction costs can be defined as the overall costs associated with the development of a built asset, project or property. The construction costs is classified into two (2) main categories and these are; capital and operational costs.

7 0
3 years ago
A cylindrical metal specimen having an original diameter of 12.8 mm and gauge length of 50.80 mm is pulled in tension until frac
Sedaia [141]

Answer:

%Reduction in area = 73.41%

%Reduction in elongation = 42.20%

Explanation:

Given

Original diameter = 12.8 mm

Gauge length = 50.80mm

Diameter at the point of fracture = 6.60 mm (0.260 in.)

Fractured gauge length = 72.14 mm.

%Reduction in Area is given as:

((do/2)² - (d1/2)²)/(do/2)²

Calculating percent reduction in area

do = 12.8mm, d1 = 6.6mm

So,

%RA = ((12.8/2)² - 6.6/2)²)/(12.8/2)²

%RA = 0.734130859375

%RA = 73.41%

Calculating percent reduction in elongation

%Reduction in elongation is given as:

((do) - (d1))/(d1)

do = 72.14mm, d1 = 50.80mm

So,

%RA = ((72.24) - (50.80))/(50.80)

%RA = 0.422047244094488

%RA = 42.20%

3 0
3 years ago
1. An air standard cycle is executed within a closed piston-cylinder system and consists of three processes as follows:1-2 = con
QveST [7]

Answer:

Explanation: Here it is: 67 Hope that helps! :)

5 0
3 years ago
The ___________ section of the bid package might include information concerning provisions for water and other utilities, sanita
dexar [7]

Answer:

Procurement Process

Explanation:

Procurement Process describes the series of activities that an organization partakes in to get products or services in order to achieve their goals. The choice of the procurement process is very important for the success of a construction project.

So during a bidding process, the procurement process is section where the organization will need to get water and other utilities, sanitation equipment or storage needed for the success of a construction project.

3 0
3 years ago
Other questions:
  • Oil with a density of 800 kg/m3 is pumped from a pressure of 0.6 bar to a pressure of 1.4 bar, and the outlet is 3 m above the i
    9·1 answer
  • WILL MARK BRAINLEST PLEASE HELP
    10·1 answer
  • The flatbed truck carries a large section of circular pipe secured only by the two fixed blocks A and B of height h. The truck i
    14·2 answers
  • Basic output with variables (Java) This zyLab activity is intended for students to prepare for a larger programming assignment.
    7·1 answer
  • A weighted, frictionless piston-cylinder device initially contains 5.25 kg of R134a as saturated vapor at 500 kPa. The container
    7·1 answer
  • Complete the following sentence.
    7·1 answer
  • Technician A says that a lack of lubrication on the back of the disc brake pads can cause brake noise. Technician B says that pa
    8·1 answer
  • The alternator must be operated with the battery disconnected or with the terminals at the back of the alternator
    15·2 answers
  • 9
    15·1 answer
  • Question 3
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!