You are given a collection of nuts of different size and corresponding bolts. You can choose any nut & any bolt together, from which you can determine whether the nut is larger than bolt, smaller than bolt or matches the bolt exactly. However there is no way to compare two nuts together or two bolts together. Suggest an algorithm to match each bolt to its matching nut.
http://tech-queries.blogspot.com/2011/01/nuts-and-bolts-algorithm.html
Refer : http://valis.cs.uiuc.edu/~sariel/teach/2004/b/webpage/lec/15_rand_notes.pdf
http://tech-queries.blogspot.com/2011/01/nuts-and-bolts-algorithm.html
Refer : http://valis.cs.uiuc.edu/~sariel/teach/2004/b/webpage/lec/15_rand_notes.pdf
No comments:
Post a Comment