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
yan [13]
4 years ago
9

(20 points) Given a collection of n nuts and a collection of n bolts, arranged in an increasing order of size, give an O(n) time

algorithm to check if there is a nut and a bolt that have the same size. The sizes of the nuts and bolts are stored in the sorted arrays NUT S[1..n] and BOLT S[1..n], respectively. Your algorithm can stop as soon as it finds a single match (i.e, you do not need to report all matches).
Computers and Technology
1 answer:
Blababa [14]4 years ago
6 0

Answer:

Check the explanation

Explanation:

Keep two iterators, i (for nuts array) and j (for bolts array).

while(i < n and j < n) {

if nuts[i] == bolts[j] {

We have a case where sizes match, output/return

}

else if nuts[i] < bolts[j] {

what this means is that the size of nut is lesser than that of bolt and we should go to the next bigger nut, i.e., i+=1

}

else {

what this means is that the size of bolt is lesser than that of nut and we should go to the next bigger bolt, i.e., j+=1

}

}

Since we go to each index in both the array only once, the algorithm take O(n) time.

You might be interested in
3. In 1989, the first handheld console was released by _____ and it was called ________.
beks73 [17]
Answer: b) Nintendo, Game Boy

In 1989, the first handheld console was released by _Nintendo_ and it was called _Game Boy_.
5 0
3 years ago
Why would a user want to resend a message? Check all that apply.
Dmitrij [34]

Answer:

A

B

D

E

Explanation:

O to include new recipients

D to include a forgotten attachment

D to respond to a request from a recipient who accidentally deleted it

O to include missing information

5 0
3 years ago
Read 2 more answers
A large retailer is asking each customer at checkout for their zip code. if the zip code is the only recorded variable, what is
Varvara68 [4.7K]

Answer:

Nominal

Explanation:

  • So while singing the question, let's further move to the answer. So let's see here and there.
  • The first option is B. S, which corrects gross sectional data, And the 2nd 1 of Nominal, C. Is correct nominal. So here are the buddha points which are given in the question.
  • The first one, option B is correct cross-sectional data, And the 2nd 1, is option C. Is correct nominal.

To learn more about it, refer

to brainly.com/question/25458754

#SPJ4

7 0
2 years ago
Your boss wants you to devise a way for remote contractors to be able to access the server desktop. There is one stipulation, ho
Sloan [31]
Not 100% sure but I can Definitely say not b or c. So you’re narrowed down to A and D.
3 0
3 years ago
Read 2 more answers
Use Python programming (or Excel) to analyze and plot a real equilibrium sedimentation equilibrium experiment. The data are from
Nady [450]

Answer:The allosteric inhibitors of integrase (termed ALLINIs) interfere with HIV replication by binding to the viral-encoded integrase (IN) protein. Surprisingly, ALLINIs interfere not with DNA integration but with viral particle assembly late during HIV replication. To investigate the ALLINI inhibitory mechanism, we crystallized full-length HIV-1 IN bound to the ALLINI GSK1264 and determined the structure of the complex at 4.4 Å resolution. The structure shows GSK1264 buried between the IN C-terminal domain (CTD) and the catalytic core domain. In the crystal lattice, the interacting domains are contributed by two different dimers so that IN forms an open polymer mediated by inhibitor-bridged contacts; the N-terminal domains do not participate and are structurally disordered. Engineered amino acid substitutions at the inhibitor interface blocked ALLINI-induced multimerization. HIV escape mutants with reduced sensitivity to ALLINIs commonly altered amino acids at or near the inhibitor-bound interface, and these substitutions also diminished IN multimerization.

Explanation:

6 0
3 years ago
Other questions:
  • Which type of energy conversion is an electric generator designed to perform?
    8·1 answer
  • Which type of engine has been used to power airships and/or dirigibles?
    13·1 answer
  • Which us electronic company was the pioneer in home video game consoles?
    13·1 answer
  • Why are some studs and bolts undercut in the middle?
    11·1 answer
  • What type of link is used to call this file shown below?
    5·1 answer
  • Why were american colonists unhappy with king george iii?
    6·2 answers
  • The data set monarch from Computer-Active Data Analysis by Lunn andMcNeil (1991) contains the years lived after inauguration,ele
    9·1 answer
  • Number the steps to describe how Tristan can complete
    6·2 answers
  • Identifying the Property for Setting Page Breaks
    8·1 answer
  • Can i get some help please .
    5·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!