Question: Bob has a set A of n nuts and a set B of n bolts, such that each nut in A has a unique matching
Bob has a set A of n nuts and a set B of n bolts, such that each nut in A has a unique matching bolt in B. Unfortunately, the nuts in A all look the same, and the bolts in B all look the same as well. The only kind of a comparison that Bob can make is to take a nut-bolt pair (a,b), such that a is in A and b is in B, and test it to see if the threads of a are larger, smaller, or a perfect match with the threads of b. Describe and analyze an efficient algorithm for Bob to match up all of his nuts and bolts.
Step by Step Solution
3.59 Rating (160 Votes )
There are 3 Steps involved in it
This problem can be solved using a divideandconquer approach First we choose a ra... View full answer
Get step-by-step solutions from verified subject matter experts
