Question: Problem 5: Evaluate [20 points] Alan's toolbox is a mess. It has lots and lots of bolts of all different sizes. Alan keeps them in

 Problem 5: Evaluate [20 points] Alan's toolbox is a mess. It
has lots and lots of bolts of all different sizes. Alan keeps
them in bins, and they are a little sit sorted within the

Problem 5: Evaluate [20 points] Alan's toolbox is a mess. It has lots and lots of bolts of all different sizes. Alan keeps them in bins, and they are a little sit sorted within the bins. For example, we know that all of the bolts in the first bin are smaller than any of the rest of the bolts. We know that all of the bolts in the second bin are smaller than all of the rest of the bolts, except those in the first bin. And so on. Let's think about a way to help Alan get organized. Let's say there are n bolts and no two bolts have the same size. Each bin contains exactly k bolts (i.e., there are n/k bins), and the bolts in a given bin are all smaller than the bolts in the succeeding bin and larger than the bolts in the preceding bin. We are going to use a decision tree approach to construct a lower bound for the number of comparisons required to put all of the bolts in order by size. b) Recall that the number of permutations is equal to the number of leaves required in a decision tree to decide the problem. Use this information to give a lower bound on the number of comparisons required to put the bolts in a total order. Show your work. (c) Finally, use your insights from this process to write a very simple optimal algorithm to sort all of Alan's bolts

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!